From patchwork Thu Oct 3 15:51:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175111 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp538057ill; Thu, 3 Oct 2019 09:15:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpT/IbWEKW4F5ESiktLiR1Uo0NiT8H1tdeErf/z7CXY5BzR/nfMNijzM3nzfBDjAgex79c X-Received: by 2002:a50:9eac:: with SMTP id a41mr10590590edf.193.1570119349240; Thu, 03 Oct 2019 09:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119349; cv=none; d=google.com; s=arc-20160816; b=sfVR/AQaYcpepx5ZqxWDiu+hoVSMuC9gq/oGghLO2/NNVTqIphOUzOL9Wqw/tqf71g cDIn6SyrnukqcuqwG8DU6BuiXnuyPLH8n/3WrL+QXLPYvmWCERlVpGLGZpsqcwbCyiRk edir8aMLwoigY34RO4QUxktxRffeF33rMrj2Hji0rzwRJb0TyJvZjQVsKq7tccl3fyO1 MIORuNBUxe9JgibHXxfhsWkXAyQf6goojJ3bVVOk58epieT5cD4+O73d3vOOMkMIwvyP 8XEzZu4mei+fGanFSmYRdLokChfjVcbERSBUlRnPXbzkaEOWEKqnQpx5ccRuF6grjR1V WioQ== 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=87fRxmIUs5e3V5a82jMkk4zv83ahVA5y1pastdJYZd4=; b=ietL6EYPobgiIzHOVCQIfRv8hzUC/Xfiy48ppZzBAQeLaKVDYClQwJlgrisCPmKPYv TCtRUCN4iZVnP7nG8Tcw4QmAHR1U1Uws7e0O+Dv0YKbPCkmirqsd2R+81IGiHIBL+R8b OkGTor+RnlpED5CmT1Zpw5wlO83dSmgajLu0EkgKxA+fxCLWVmCYjjPsw3L7xqlGHPuT UR8u5CJJ1xJZkvwtMz+PldWwj0IeXy9F/ZffPNlxhHy+eLwPPlRuxpOU4Wsq4BQsOKm0 1/Do0I712b+E2HrimKMiXRPS7e4RATdnzQbh1wKMFyg8wt4vwCKn3ryz7ELqBvYFvyLU cC1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aVo+SH95; 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 os5si1413952ejb.61.2019.10.03.09.15.49; Thu, 03 Oct 2019 09:15:49 -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=aVo+SH95; 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 S2387509AbfJCQPq (ORCPT + 27 others); Thu, 3 Oct 2019 12:15:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:40070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732566AbfJCQPo (ORCPT ); Thu, 3 Oct 2019 12:15:44 -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 996AF20700; Thu, 3 Oct 2019 16:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119344; bh=wzC2i8rWj55dG81tZm2kN6D/gSngbg12o66ItecxI1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVo+SH951+aKYddvjpIW8qQtuE6VcUfwAOqOwycnt5UD6lLDRgy3AicxxnztGoR/w vlvElBy8c7NSA7HGACu/4MGMh0X2dzWfW6Ym8Z6PUActhIJLCCIvj2upKpZ9g2maUS VpWL9GNynjOG14EJSJ0RDUTSSSu+yETf5e5Etz6k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Jakub Kicinski Subject: [PATCH 4.19 005/211] net: qrtr: Stop rx_worker before freeing node Date: Thu, 3 Oct 2019 17:51:11 +0200 Message-Id: <20191003154448.374654811@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@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 @@ -157,6 +157,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); }