From: Lee Jones <lee@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net,
linux-can@vger.kernel.org, kernel@pengutronix.de,
Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: [PATCH net 2/6] can: bcm: prevent thrtimer UAF in rx path by checking RX_NO_AUTOTIMER
Date: Wed, 13 May 2026 16:00:36 +0100 [thread overview]
Message-ID: <20260513150036.GF305027@google.com> (raw)
In-Reply-To: <20260513-abstract-purring-inchworm-f6daa3-mkl@pengutronix.de>
On Wed, 13 May 2026, Marc Kleine-Budde wrote:
> On 13.05.2026 14:59:13, Lee Jones wrote:
> > On Fri, 08 May 2026, Jakub Kicinski wrote:
> >
> > > On Thu, 7 May 2026 10:22:24 +0200 Marc Kleine-Budde wrote:
> > > > Commit f1b4e32aca08 ("can: bcm: use call_rcu() instead of costly
> > > > synchronize_rcu()") removed the synchronize_rcu() call from
> > > > bcm_delete_rx_op() and introduced the RX_NO_AUTOTIMER flag to prevent
> > > > timers from being rearmed during deletion. However, it only applied
> > > > this check to op->timer via bcm_rx_starttimer().
> > >
> > > All AIs point out this is insufficient:
> > >
> > > reader (bcm_rx_handler, RCU) | writer (bcm_delete_rx_op)
> > > -----------------------------+-------------------------------
> > > test op->flags (no AUTOTIMER)|
> > > | op->flags |= RX_NO_AUTOTIMER
> > > | bcm_remove_op()
> > > | hrtimer_cancel(&op->thrtimer)
> > > | /* not armed: no-op */
> > > | call_rcu(bcm_free_op_rcu)
> > > hrtimer_start(&op->thrtimer) |
> > > return from RCU section |
> > > | grace period elapses
> > > | bcm_free_op_rcu() -> kfree(op)
> > > thrtimer fires |
> > > bcm_rx_thr_handler(op) | <-- UAF
> >
> > Noted. Leave it with me and I'll follow up shortly.
>
> Please send a new patch against net-next/main, I'll drop this one.
Wilco - working on it now.
--
Lee Jones
next prev parent reply other threads:[~2026-05-13 15:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 8:22 [PATCH net 0/6] pull-request: can 2026-05-07 Marc Kleine-Budde
2026-05-07 8:22 ` [PATCH net 1/6] can: raw: add locking for raw flags bitfield Marc Kleine-Budde
2026-05-07 8:22 ` [PATCH net 2/6] can: bcm: prevent thrtimer UAF in rx path by checking RX_NO_AUTOTIMER Marc Kleine-Budde
2026-05-08 22:12 ` Jakub Kicinski
2026-05-13 13:59 ` Lee Jones
2026-05-13 14:17 ` Marc Kleine-Budde
2026-05-13 15:00 ` Lee Jones [this message]
2026-05-07 8:22 ` [PATCH net 3/6] can: j1939: fix wrong RX timeout for CTS hold messages Marc Kleine-Budde
2026-05-07 8:22 ` [PATCH net 4/6] can: j1939: fix lockless local-destination check Marc Kleine-Budde
2026-05-07 8:22 ` [PATCH net 5/6] can: peak: Modification of references to email accounts being deleted Marc Kleine-Budde
2026-05-07 8:22 ` [PATCH net 6/6] can: flexcan: disable all IRQ lines in flexcan_chip_interrupts_enable() Marc Kleine-Budde
2026-05-08 22:11 ` Jakub Kicinski
2026-05-13 14:17 ` Marc Kleine-Budde
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=20260513150036.GF305027@google.com \
--to=lee@kernel.org \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox