Article View: linux.kernel.netdev
Article #9161Re: [PATCH net 2/2] hdlc_fr: shut down the LMI timer in fr_destroy()
From: Simon Horman
Date: Sat, 31 Oct 2026 17:29
Date: Sat, 31 Oct 2026 17:29
30 lines
8974 bytes
8974 bytes
On Wed, Oct 28, 2026 at 11:23:10AM +0800, Chengyu Liu wrote:
> fr_start() arms state(hdlc)->timer when LMI is enabled
> (settings.lmi != LMI_NONE). The only deletion lives in fr_stop(), which
> is unreachable on the protocol-detach path: detach_hdlc_protocol() calls
> only ->detach() (never ->stop()) and then kfree()s hdlc->state. FR's
> ->detach, fr_destroy(), tears down the PVC list but never touches the
> timer, so unregistering an up FR device with LMI enabled leaves the timer
> armed on top of freed memory; fr_timer() then fires into the dead
> frad_state.
>
> Shut the timer down at the top of fr_destroy(). Use
> timer_shutdown_sync() so the timer cannot be re-armed afterwards,
> matching the CVE-2026-63803 ppp fix (ppp_timer_release()).
>
> Initialize the timer in fr_ioctl() when the protocol is attached and
> drop the timer_setup() from fr_start(): attach_hdlc_protocol() uses
> kmalloc() (not kzalloc), so state(hdlc)->timer is uninitialized garbage
> until the first timer_setup() and fr_destroy() must never run
> timer_shutdown_sync() on it.
>
> This bug was found by static analysis and confirmed with a KASAN
> reproducer: slab-use-after-free in the timer softirq after rmmod of an
> up Frame Relay HDLC device with LMI enabled.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Chengyu Liu <19290937@qq.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261031172905.GR257209@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354107-linux-kernel-netdev=dewy.ruReferences:
<20261028032310.2832307-1-19290937@qq.com> <tencent_01EA70DD2A37DFF1634781DAD4E349400008@qq.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354107-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 2/2] hdlc_fr: shut down the LMI timer in fr_destroy() Date: Sat, 31 Oct 2026 17:29:05 +0000 Organization: Usenet Network Message-ID: <20261031172905.GR257209@horms.kernel.org> References: <20261028032310.2832307-1-19290937@qq.com> <tencent_01EA70DD2A37DFF1634781DAD4E349400008@qq.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2509612"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:2UM9GRIvzxUSGpmQ6+7eb+rn/iw= sha256:ET5LyrgdD8VgZppd/DX2UkkgoVuf4PHbBGwA8pYq5Fc= sha1:MF+bwEPN1h6EwKIqG2tpzfXzc9s= sha256:JS5sfE8kRiBGwfaO0A0vou678Do+vGYEngLibmkDM8M= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id EF1A5125CB7; Sat, 31 Oct 2026 20:29:36 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 73rzJO5--CrH; Sat, 31 Oct 2026 20:29:35 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-354107-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 056D4125CB6; Sat, 31 Oct 2026 20:29:25 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0C8532666B; Sat, 31 Oct 2026 17:29:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793467750; b=f3d5A2AYbxG1MTzqlxeE5xxOH/zQTZaYRIZwDwTE8oYpNNj342Bo9ndhUgeYuwUBR96M iOjS79yGWtUEe9EEBNQkCJAcrW4EXCSVrHEWgeEHfT2cBSZ9pTnz9YBHL7x6TfssxEpFE qOIdEPbDjz87meyrEi89GGox2fyfnNP8tIrH11PB7FfrvRpSMyU1l3iPOwRXDoWtu/2rN q1qqPQk/UUdjdPtkpQ48QWwfHDJxh7/hY5mhLLsooJ3N4aVcRZcxjpITuypoi5yApyaMu 36s0OlZ6UdktPb1f08/NyyuWrcymIYLUN2wh2k8oPCguodKspIJB7lp2SDv/uy+4uxA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793467750; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FKmueVCGRcuZBIHCsJR/B5UULYSvaoNnz+4Pg3U8f2Y=; b=AlkxylWUQeOjw4EXuDueka9gqxllru/oLkVJ7Zn8whllwfkGgSPQFAGETV33zQ357x5B kpMr1/GscjZgInLpL2bGFsjU8mkL0xdv4sSbPF7WkUVTQtbniyBdSIvaATKTv4Ium2apz HM0LNV8nhs3rAJ7fM63X4x/oBXHKiWjIhI/z1G8RC8u7P/VGRc5MapYgcbJNKVEORjsPO 2a5dvJLqtivvKW81/IZr6FBCMZmaKJJC1B+ykwXCYJiipvDQ7kEtGXqvVoqEcF++BIPQL 1oDB+BT5zKUU61y3Eqs2PnxPraUN+PFlza7G42vw/MJM2a3rBc3yb8aGQWVFZtdoc3g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=loussU1J; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BAC4606A330; Sat, 31 Oct 2026 17:29:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=loussU1J X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793467749; b=Y7NL94MMK79WdL7VUqSGPDgG6TFb1flTha8Z49yTNHRy+NzBKis1A4Y4mzcdMsIYVxXv psD/iff22sWtwCAZN15RdlUgYcUVdPfb/HSYGd9Muf5Q/pCmrN/ENGv5juVvZQMqYEoG8 7kzc/FxKqEvKBSTCppRwTw0LLwtYqjrtDzEr9MatzLpMSfn7tbmStu95tO5dpKn1KBswi K1LjomGK4yBFb5bXWB8j4TSc8K5Xe8jRHBDSX9s+kscMsLgFkfCTpib/icNM47Rdxcs3i KAcvNB+iD3W4bO7eagryDGHIHkCAELmtOaH5QwqM85zNmT+FlHIYEQuUiO6p2JIXJZw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793467749; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FKmueVCGRcuZBIHCsJR/B5UULYSvaoNnz+4Pg3U8f2Y=; b=fCnZuz/y39VVXWIVtjPhVNbdkVMaSl1NJMX7OIQgs7p7iuFUpjVU6jh/KxoXebUjKQWg FSo/Hl2+N92PMYUzxj9shZNI4ndt19cE0Mp1dYFMCBCTFq9askGxOyfHLWQnRxXM5ihwi Yf4l4xk15K0K0TjF/mn+SMqvDJfVZ232nlUND4nZCRxpJdbMJmMxeesZ2D5euMf4xELa3 BWiE1boNIZkg0JmCkHlLrBMgMPV96uK9Kt2XIjB+sKRJvJAoQjtUOs1Bgc7aLsyFdp6OF JfBneqbBeSW+M3zV1WSoXqdMLaZ5uUf7TXTndgEIvzUCM1pBDkw4WJGh38sCkn/LQOA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=loussU1J; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14A53606A323; Sat, 31 Oct 2026 17:29:08 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3A9B1F000C1; Sat, 31 Oct 2026 17:29:07 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793467748; bh=FKmueVCGRcuZBIHCsJR/B5UULYSvaoNnz+4Pg3U8f2Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=loussU1JL3PFSsLQzU4dbaShzWV8CYZj2upYd4J9A/OIDsJgHrFVbj++Llbgqb7/T J2cing2PIcjR4D/piPXlQSaKJU0sZHwzn7eX+YkOsOd65PBf53mzTqpA40p8DmX0nu DfbyVlvoxHmmFciSag1GWzn3LoO3EK61perlp2JbYtA1LJm3UB0BSF3p1U3tVuGoFY Nz20xlAjDR4zWFERUQ1lwsJPkI5+YlrKrOK353/t/AlAzckEuwqpAAqbrj4Jz4AVVD Fr/os9bCLg421VgtCTL+IND3C0AgbuRCOllNUiPbSaoa3AmcI/UoqBz0TIshDvulM3 ynx46E2GSb/kA== X-Cc: khc@pm.waw.pl, netdev@vger.kernel.org, stable@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <tencent_01EA70DD2A37DFF1634781DAD4E349400008@qq.com>