🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9160

Re: [PATCH net 1/2] hdlc_cisco: shut down the keepalive timer on ->detach

#9160
From: Simon Horman
Date: Sat, 31 Oct 2026 17:28
34 lines
9234 bytes
On Wed, Oct 28, 2026 at 11:23:09AM +0800, Chengyu Liu wrote:
> cisco_start() arms st->timer unconditionally and cisco_timer() re-arms
> itself on every fire.  The only deletion lives in cisco_stop(), which is
> unreachable on the protocol-detach path: detach_hdlc_protocol() calls
> only ->detach() (never ->stop()) and then kfree()s hdlc->state.  The
> cisco hdlc_proto has no ->detach at all, so unregistering an up cisco
> device leaves the keepalive timer armed on top of freed memory; it fires
> within one keepalive interval and cisco_timer() writes through the dead
> cisco_state (st->lock, st->txseq++, cisco_keepalive_send()).
> 
> Add a ->detach callback that shuts the timer down permanently before the
> state is freed, mirroring the CVE-2026-63803 ppp fix
> (timer_shutdown_sync() in ppp_timer_release()).
> 
> Initialize the timer in cisco_ioctl() when the protocol is attached and
> drop the timer_setup() from cisco_start(), so the timer is initialized
> exactly once at attach time: attach_hdlc_protocol() uses kmalloc() (not
> kzalloc), so st->timer is uninitialized garbage until the first
> timer_setup() and ->detach() 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 write in __run_timer_base() within one
> keepalive interval after rmmod of an up cisco HDLC device (allocated by
> attach_hdlc_protocol() via cisco_ioctl(), freed by
> detach_hdlc_protocol() via unregister_hdlc_device()).
> 
> 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: <20261031172849.GQ257209@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-354106-linux-kernel-netdev=dewy.ru
References: <20261028032310.2832307-1-19290937@qq.com> <tencent_9E404EEA5DDD9E37C7F105470FDA49E36708@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-354106-linux-kernel-netdev=dewy.ru
From: horms@kernel.org (Simon Horman)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/2] hdlc_cisco: shut down the keepalive timer on
 ->detach
Date: Sat, 31 Oct 2026 17:28:49 +0000
Organization: Usenet Network
Message-ID: <20261031172849.GQ257209@horms.kernel.org>
References: <20261028032310.2832307-1-19290937@qq.com>
 <tencent_9E404EEA5DDD9E37C7F105470FDA49E36708@qq.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2509490"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:lsqlj7ipuihQw9rtBcSWbZdgrcg= sha256:bmLAeNfydEhjlWKUZsEbmAxs853Dq8qtjesrRZHTJg4=
	sha1:wbcM+ogXLapVmQTWJUQaPith7M8= sha256:P+ycpmkM29uipx8Kl1GxpqbFgvgBbQEStdgntxblgl8=
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 3B1B2125CB7; Sat, 31 Oct 2026 20:29:11 +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 okxoIUxb1j1g;
	Sat, 31 Oct 2026 20:29:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-354106-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 2928B125CB6; Sat, 31 Oct 2026 20:28:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 59A0022878; Sat, 31 Oct 2026 17:28:57 +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=1793467734;
	b=a4ejkP5NKndXcwHgzjrFaxWBzIvg3ZoNRjBedM8sNBA26fCSFMx/0ofpBQzvZNHVff6o
	 MWuLJmMfTT6sCiUB7Ez2sLm+BqzCYfh9aGWAKbzIf0W7D67CWCBkI5JsExSt9MLqN+yTD
	 0O7gzXcHYh9OS9EuXm98KLM3v3dPJwvX6O5BfBRJh1aBsBDLFeIT2NrJAlIJWrdX9eR4e
	 Zk24DC1QGuEXCphuAGWkyAfwodqjJVrLpZSZ+MUeKD6y4Fg0AgXD2W2eZASCWqgKWGXcL
	 DL0NWZ3y+7VNYUsRTGMtaPpd+3OKUNzmeWjpc64TiPFKtIldlTJEPqt45JGIoIqpevg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793467734;
	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=fljbL493IUPPYVoeHdRJWLxY37C0tj/X+LDqheFscps=;
	b=baHX7WMnLs9gB8KB8r3rhjyF9goTu8xVoAXRF2nWJ6jwVjJj22nnpjVaGUZ1KTOsOH1t
	 bRamuc/b+u49T2EZv01fp/0HSCAVjttmtvjgAwZ0EK7q6qaz9s0FoWfTszpLiY/MIN9Or
	 +bf5Qrt/AlHZN9T174kyH460NTjrNJBXCKgpZfTcMnUMbic4AQwdIGjNdyq5Iltg6xQIf
	 w46ecoLe28XOL5ewX1JlS7oNzdUxFcg+iLpRa8T7/pfze66MHYPLGMYXYJQxE5bRBxBjk
	 gndtBoTrhlrC4Qlij5JXMzCFSnl+yOEk+8TkB8hCBp8PfKK5ggtCfM8BFsxSAr72xug==
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=Hl2zevIo;
	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 BF210606A322;
	Sat, 31 Oct 2026 17:28:54 +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=Hl2zevIo
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=1793467733;
	b=rXHPeNjaHLPIPDe8YiYU0tZUzRo9nc4zElinJxzQcoHYo4yz9NdiizBNiwVEfribBc1Q
	 K9MohH2JptAs3bS8tyO+Ii7LHuJ5VhOxoL6fbNnqsC6T6fI4l+9/ULPgKu6UgvRwyAcwY
	 udoUpkiYEfib4L1ozanclEVoJU9bmhsk9i1MQJJukwzwkiOmEdi7qJIHQAvLNlklTE+GS
	 gu3yRnL2Ls2euipQs+U/fzItVVV76d7o7kPXdxLi+hIZc37nWecx9SWLj1A9bNQhw9eXW
	 Js2TInypMxEJ4zT1J6BSEahdE5z66uuGb0L3IoLcm24+vGme/YjdbGVvAhwuuIz8ERw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793467733;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=fljbL493IUPPYVoeHdRJWLxY37C0tj/X+LDqheFscps=;
	b=gFywS4LE9pShvwZdoVxR1OUNdqvcpB/sMd01cfB8BgfNQfTJ19d0tiH4gz0qFeiEQxY6
	 CuYjCFprPL7xoifCqrzgHSWy0eOuKHiObp7hDuzUZcHeVHhfyAH5nF53JGixB2rOH+/97
	 ostVYc7bgJ0jTDSuEREPnWxERZOXJFQO6Puz6mFfwelCWWhB8vgeUoetukE/tEtFscxNb
	 nFOD3FPjJt7IQn0bwMGR6l4O3Deac9qLock8q+vU+UKDNEbtGo6tUgIzHodiRklItW+SZ
	 t1782MSx4iTQA14B6wbavK3KTwltBWafRRbJ+uDwDvt+2OuwYAa0ZiaBiHA625B1QdA==
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=Hl2zevIo;
	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 9C0A4606A31A;
	Sat, 31 Oct 2026 17:28:53 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D40D1F000C1;
	Sat, 31 Oct 2026 17:28:52 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793467733;
	bh=fljbL493IUPPYVoeHdRJWLxY37C0tj/X+LDqheFscps=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=Hl2zevIo9ukOm9ASfdCuciWrJiNT2p9e5Fp0wSBpAR3zSGToUbRarVAAcYMSvG0sg
	 JE4yZy8TxdwBac733I+KnC/5teH9h88aVaJXdAgDvIb/8NQt9tqUH9dFDCQKrVLy5o
	 A9m1KDEqn1lAGLwEb4k9mje+FTIIh96D5swDIdV4cSWjyPAi7MEq8frFZWPVAg69Jn
	 zVoPtRlmE/jWM9sURuFSChGf6X7qTqaUWWqhd4ktmQyh3xCPJ3aVwVMjF4krWmW5LM
	 ynelmT4ZdaI0PcZx/VhSXrkcYSnopz75u1C+4VcWRAfs2I2xnER25Njp6VEIxo71e8
	 2ho6qd2WJaasA==
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_9E404EEA5DDD9E37C7F105470FDA49E36708@qq.com>