From: Simon Horman <horms@kernel.org>
To: Chengyu Liu <19290937@qq.com>
Cc: khc@pm.waw.pl, netdev@vger.kernel.org, stable@vger.kernel.org
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 [thread overview]
Message-ID: <20261031172905.GR257209@horms.kernel.org> (raw)
In-Reply-To: <tencent_01EA70DD2A37DFF1634781DAD4E349400008@qq.com>
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>
prev parent reply other threads:[~2026-10-31 17:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261028032310.2832307-1-19290937@qq.com>
2026-10-28 3:23 ` [PATCH net 1/2] hdlc_cisco: shut down the keepalive timer on ->detach Chengyu Liu
2026-10-31 17:28 ` Simon Horman
2026-10-28 3:23 ` [PATCH net 2/2] hdlc_fr: shut down the LMI timer in fr_destroy() Chengyu Liu
2026-10-31 17:29 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261031172905.GR257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=19290937@qq.com \
--cc=khc@pm.waw.pl \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.