From patchwork Thu Oct 3 15:49:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 175144 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp569203ill; Thu, 3 Oct 2019 09:39:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVY1QzAhEuKMplQ9HXwzhjjjR9H2opyD8p8ww2SC+TjQN/AWLQk5jRU7rXOcWTPOm2jNXt X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr10362566edx.6.1570120770474; Thu, 03 Oct 2019 09:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120770; cv=none; d=google.com; s=arc-20160816; b=tVgLcJJaU8SgNvvXnl03cXy1xS+dedIzNrbX5Chn4p4qZ8NTKKHbeFDUrmC8WE2eb6 hE+M7JFMDxNJTSVUfX/ZgIU+E/OaUQP1ZB1PsGEWid8XZzkBuZ9fDjdHADk9mzOu1Tcg +HFX7WR/kTlKkEa46fyrIETAaglsmwMVpng8UDJ4YdVeybwAKFlw/9fs1TOlTBO8qHze wovFf2GcTNn4weEpYsChgI9ADKf0dUyKhz5hJO2pCx5Y5U4B7BDOOoEjNutcUJBIgjj5 mlV3Bbyz3uiq1etMLGNm2HLzRysCSAUFy5tGk4Aio/0VbUIzcspLPAFCxL3dcwGpvVks pPfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wnTM9D7gjE73iv/01ERT6DtJGUzHADOdRS2lRhk8bJU=; b=YFyzyDrTt4Vjnbu7TbLpJrorXhHpcMAcH+t1gUBJL9no0+BjCIXPJs5Voz1uof0PAP HZ2k3/ciNMAKWA7Y5CabKtGWLzIfxkfLo97Gc32Y8zPEpFGXfgPtGjdqVYCee4Pki2uU Uvq0TOn5QjLio+jLMkXKoCwHuJqK2FQTbQgvfdUoN2Jb2MFkrdhM2t41wo1zeIJYWmuS JFoVMQCPsQCxm9qtIP6+MAUHTkYpewUdmwUmPocbRKQoT/JmENyGE/H2wcBg4dmEtxJ8 FKwfQfbzOOlNVOS32m/uXwRfOuDdkJ+ROekVCxuO+cQQYLHWJXOVi8fSHiAfEKHB5MlR f0cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jSlRZAxu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12si1905204edb.262.2019.10.03.09.39.30; Thu, 03 Oct 2019 09:39:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jSlRZAxu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404776AbfJCQj0 (ORCPT + 27 others); Thu, 3 Oct 2019 12:39:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:49316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404735AbfJCQjY (ORCPT ); Thu, 3 Oct 2019 12:39:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CFF3C2070B; Thu, 3 Oct 2019 16:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120764; bh=kvo8e6FkZ7qO+5CeiOkhJiM1oUsYCDpijb9DiyqS2Zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jSlRZAxudCrtv6r2AxJ7xZSM08/gO8yY7b4L2BXb1OIH19MZjiKrK+AE62WZnwZ+l TcJ0WfxbDEVSd2G5FLUAK/Rsg1uJ8141I66vgJtke97nT40lcdsjkMJ2kulCnJ0M35 UIYkJ1lqI6TMZNpD5FaLPrVKUWzWbUGKQFT40xqI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Jakub Kicinski Subject: [PATCH 5.3 006/344] net: qrtr: Stop rx_worker before freeing node Date: Thu, 3 Oct 2019 17:49:31 +0200 Message-Id: <20191003154540.701536820@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154540.062170222@linuxfoundation.org> References: <20191003154540.062170222@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson [ Upstream commit 73f0c11d11329a0d6d205d4312b6e5d2512af7c5 ] As the endpoint is unregistered there might still be work pending to handle incoming messages, which will result in a use after free scenario. The plan is to remove the rx_worker, but until then (and for stable@) ensure that the work is stopped before the node is freed. Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/qrtr/qrtr.c | 1 + 1 file changed, 1 insertion(+) --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -150,6 +150,7 @@ static void __qrtr_node_release(struct k list_del(&node->item); mutex_unlock(&qrtr_node_lock); + cancel_work_sync(&node->work); skb_queue_purge(&node->rx_queue); kfree(node); }