Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB876C433B4 for ; Wed, 12 May 2021 17:06:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75C2F60232 for ; Wed, 12 May 2021 17:06:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75C2F60232 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mleia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MFyFpzcb794sy49GzogP7OUttxQvMz+JxQk9tzQCUF8=; b=Bn9Ip6d7Da7DBcjTZx7YkTW6X 3wnV0GkVaNue3QoDRXXoBCyhk9ki4ht11NYSi+rTcjAP2c7XEe0sdRm9Nm3px45+YiaVlQ52jbapp +lSUOp/HkLlXpEFvi3FRbsla00J8ZJhsJ9qW0vJugL3e4rImOhRAk4/Pi9zVNIQfhKzAwqGe7Zz4l LPj2rtYws4eJ8LpBpZOGLY1qUiXeWTeuODAzM9FlNDmAb78X0cqhbFKRYhMyZJ6r5SaJWdJVV+9Uo ZioMkPe4mmx3G4Zoy+65/qYW+pUE5LO/KiGx7VgiqSDPg39AimPvKZ5nNklJWUcbTqrm5fz5a9wUA odNL/zKHA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgsHn-003P4M-TO; Wed, 12 May 2021 17:04:40 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgsHl-003P42-MP for linux-arm-kernel@desiato.infradead.org; Wed, 12 May 2021 17:04:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=Iqm/kKc8UvAGY4mUdB/+Ch7W/4QIYQlonLscJfgNmuo=; b=TR6NlyUF0eWKoSTn4vvHlYdBxi CnHlSOiTBsow3GM6tcZE0H4JzTLgqTdiIGKJXPVCOIP7Xl3sX7yTEtQk4IPz29vHbWZIDhOvpfPFL GlYOB19ZvtjNB8xziLG7HFoX1pzGayAtZmEDkVI/StXxqrTuS/yd71dSwXkEC5iAt02DtLDBxDwXm 7WdV+3LoVTzHENRUIkR4UoVYH0hu6Q1sAlRTvlxlZ8VT5fpGi/CcsxuNFvww4OxUDa7vzIfLNTiqF /+s67jxDbcgC7T+ULYLjEoXmFdZei+JuXdjK7oLe6HFSfeNUhUq/XjnAfgHoFsKYJdh6RjfhKpuon +WBKIY+A==; Received: from mleia.com ([178.79.152.223] helo=mail.mleia.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgsHj-00AcuU-53 for linux-arm-kernel@lists.infradead.org; Wed, 12 May 2021 17:04:36 +0000 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 1E5D31264; Wed, 12 May 2021 17:04:28 +0000 (UTC) Subject: Re: [PATCH -next] watchdog: Fix possible use-after-free by calling del_timer_sync() To: Zou Wei , wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1620802676-19701-1-git-send-email-zou_wei@huawei.com> From: Vladimir Zapolskiy Message-ID: Date: Wed, 12 May 2021 20:04:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <1620802676-19701-1-git-send-email-zou_wei@huawei.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20210512_170428_148887_70604D62 X-CRM114-Status: UNSURE ( 7.50 ) X-CRM114-Notice: Please train this message. /bin/ln: failed to access 'reaver_cache/texts/20210512_170428_148887_70604D62': No such file or directory X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210512_170428_148887_70604D62 X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/12/21 9:57 AM, Zou Wei wrote: > This driver'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 Acked-by: Vladimir Zapolskiy -- Best wishes, Vladimir _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel