Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp625300pxv; Thu, 15 Jul 2021 11:51:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy0/7/XXQp/QfbVrtQIaPIYUacab69nETAs9BVYRozryop2+3oYyfWe1ueEcPVpwTKksNa X-Received: by 2002:a92:9509:: with SMTP id y9mr3652034ilh.18.1626375093999; Thu, 15 Jul 2021 11:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375093; cv=none; d=google.com; s=arc-20160816; b=PVHjLZMf6m8F3Om0kgQbFibHlmGi5E3BSMHDuwI73DvbgZvD7v/kHz6AYDe6WzT/O4 Vn7P4DPYkZAjgEVnVibS7FHqqIk+wWEEzslZ+fYMRT+mnhb2ik1KXY5gi4MHvqC/Eo9Z yAnC9pcqwgIeEtJSjfsIE1txB6wELMgr+TShlV51fDDz0I31Wz0bomnL871gM+MFdxjq 5vNDpV1yR6q7EFNI6hOutrjhEce/aVx6nPGh5fs92yKxSVzdz+Hgi0kHaIioeAGynqIb rz3kfhOEMHdQkjKLrCYVjXVEHI9yGZ1y/tR6NWoLgNw2Skf0sd6wWfPInJgdbE4GnhLv eBfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Pw6JR9mPf1O1jnw9Q4pt95PufI1FTT7ODjUJAkqQdeU=; b=sW+xFG5BDx9Hrp8kWbWg+R6gpxr4Zz6Zkx4BOJMpGnczN4+qwM89SBoW8xCi/EfFLi 9d4V95IF65xa1UqJu7uUWDQwv60pkkXkw6j3+KzdEeuPvNurLY4ux9/WeRm1eBSf88yB Qa6N5m2m4CXdK2fHM3tz1H3C7Q+p97KbDxDFAz/niaIwhGVe/5D0yErUHan1V9FDttNY rhCwWI1SSXCq1NTMT/3IWqTURwVxpIxzKEFR+xKbICdX7Ow4cHI1PMpSut9qfeWmixpC nAYOLWsQ145htFKCOfMD6h8scjQmrFcpkR8QeJEWzvqEoIryDwTWnKhxotJH7CDsvVaw rC6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I8175c5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si7213161jat.100.2021.07.15.11.51.21; Thu, 15 Jul 2021 11:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I8175c5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239928AbhGOSxn (ORCPT + 99 others); Thu, 15 Jul 2021 14:53:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:50488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239866AbhGOSss (ORCPT ); Thu, 15 Jul 2021 14:48:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8E95613D2; Thu, 15 Jul 2021 18:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626374754; bh=wdCXofuB2KYAO8nzZBa7xRnRlrsESV5l62oHr9sXKgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8175c5Mo2oFaD97h59AKw4XzBJ+UIQgDDExif5MV/6aSLiD8mBC40YEepi/crHFD tWrFMDDhpitlisgmwpBOKUt/kccuyrLNIZyVyvinnfwQ8SIxsrjAM3Lyt4/RvHttov UjhoO0VZcEfr4LDTDzVIdjNfKlM2c5BswLBTGkOA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zou Wei , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 012/215] atm: iphase: fix possible use-after-free in ia_module_exit() Date: Thu, 15 Jul 2021 20:36:24 +0200 Message-Id: <20210715182600.810178655@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zou Wei [ Upstream commit 1c72e6ab66b9598cac741ed397438a52065a8f1f ] This module's remove path calls del_timer(). However, that function does not wait until the timer handler finishes. This means that the timer handler may still be running after the driver's remove function has finished, which would result in a use-after-free. Fix by calling del_timer_sync(), which makes sure the timer handler has finished, and unable to re-schedule itself. Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/iphase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index eef637fd90b3..a59554e5b8b0 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -3279,7 +3279,7 @@ static void __exit ia_module_exit(void) { pci_unregister_driver(&ia_driver); - del_timer(&ia_timer); + del_timer_sync(&ia_timer); } module_init(ia_module_init); -- 2.30.2