From patchwork Thu Oct 3 15:51:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175104 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp528553ill; Thu, 3 Oct 2019 09:09:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLzV9y1m1cnmxgIsBx/daDRk0VEZ1j8KTC6kgdE9bSfXOvtJbkddZ760fPyMzQy/6e1W4f X-Received: by 2002:aa7:db02:: with SMTP id t2mr10291012eds.252.1570118871856; Thu, 03 Oct 2019 09:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118871; cv=none; d=google.com; s=arc-20160816; b=jTpFB/Gke90NXVC8L3kYRy1B46mJNYxixTRmcOLlqm6RvAck41F0kojdaPjoUZ4goM f454YETvvc9GnUUqBih6cMM2WBQfnc0xKxaGLBXRawjvp+tBB7PuR2UsKdwqqNhzpOVB 3SctUQla/CfLi873DEwqhybmW4ShXN2BXblIuzSnKHCPGz2GJMRZlqUhDP9UKHC6FPeF 5GHuGd2DSNBT1I+vU26EXmA+BMWN9t2I5PAuZYE8uRuiS0R2rYxjNS6WM1ulP/l9de/V 4HGVfIjiWXPV1nWXW8Do9ha4gQKnO3ZG7SJLrJ0nAK6DfDrGCHQxWrsJHwzC/8f1Q1Bz uzbw== 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=NlJO9U6IBULnsI4a3a6TYkmbBUXozpo/ilGyLtcjOuI=; b=A/IOqIsBAa2yZRML9pR5C6Z4dMa0ekJ5fl8aJ9v4enwJPaKFnAD/2dxNsMkEWzY/8y EE/G8as7iTQmbpUtinNDRsCptvH/PIZiDNgvydKfKgtUOXCzR96u7x3wpgoRDi0ykovj zskft+o32tEjRNxXBTZ3o5YtY6NeweqRTsYkabPIbSAgCphYpAbGAEbVGCt0+L60vdvt dgPFtTUx/a82a/vB8mTd3cSJLB0hKK6pBCMkMccIK0kbI62UL35fsfRQuTqqGPMyGhzz VUkH/AxbNwqhRpepUHVZdyCGvF4y/gWkpBRVLPSKBe2595ZS78N/AzorNiIw0DSRUipq Nc+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QMy3egQS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 h14si1730133edb.425.2019.10.03.09.07.51; Thu, 03 Oct 2019 09:07:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=QMy3egQS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733008AbfJCQHu (ORCPT + 14 others); Thu, 3 Oct 2019 12:07:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733002AbfJCQHt (ORCPT ); Thu, 3 Oct 2019 12:07:49 -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 2817920865; Thu, 3 Oct 2019 16:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118868; bh=Qd6Fx4HR0MEy1fkhsPPqO3Z/s2WW9q4MQSyVMAfTlqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMy3egQSz0hb5GzBmjvJ9nqbjgeAwwGB6CclapMLVKlLQvuaZRG7+hvx1/3U6e8j8 AaskTuUxIA6knT/n5oj15eyJ9pSq0t84c2hlb6J+qjqctdiIsZ2y6Z1gvyxKn/iopa aVvSwc+Y7GoxOg/m6j2Qrs1sNFb7a5u970PmSqcc= 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.14 038/185] net: qrtr: Stop rx_worker before freeing node Date: Thu, 3 Oct 2019 17:51:56 +0200 Message-Id: <20191003154446.167148984@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -129,6 +129,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); }