Re: [PATCH v3 0/2] fastrpc: fix probe-time races between rpmsg and userspace
From: Srinivas Kandagatla
Date: Mon Nov 16 2026 - 08:57:52 EST
On Mon, 16 Nov 2026 18:57:29 +0530, Vinayak Katoch wrote:
> This series fixes two races in fastrpc_rpmsg_probe() that can be
> triggered when userspace opens a fastrpc device node concurrently with
> the rpmsg probe sequence.
>
> fastrpc_device_register() calls misc_register() before the channel
> context is fully initialised. A concurrent open() in that window hits
> kref_get() on a zero refcount, and because of_platform_populate() has
> not yet run, sesscount is 0. The error path then calls kref_put() on the
> saturated refcount, which kfree()s the channel context. A subsequent
> IRQ-path fastrpc_rpmsg_callback() dereferences the freed spinlock,
> causing a kernel panic.
>
> [...]
Applied, thanks!
[1/2] misc: fastrpc: fix NULL rpdev dereference when session alloc fails
commit: 2b22e3266386190d2027d9f12f317e0662a40711
[2/2] misc: fastrpc: fix init ordering race in rpmsg probe
commit: 1bf78aac760fd25b684153f8c477aede9b9dd634
Best regards,
--
Srinivas Kandagatla <srini@xxxxxxxxxx>