Re: [PATCH v2 0/2] fastrpc: fix probe-time races between rpmsg and userspace

From: Srinivas Kandagatla

Date: Mon Nov 16 2026 - 08:57:43 EST



On Thu, 22 Oct 2026 14:38:46 +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 fastrpc_cb_devices_create()
> has not yet run sesscount is 0, the error path calls kref_put() on the
> saturated refcount, triggering kfree() of the channel context. A
> subsequent IRQ-path fastrpc_rpmsg_callback() then dereferences the
> freed spinlock, causing a kernel panic. A NULL dereference in the
> fastrpc_device_open() error path when cctx->rpdev is concurrently
> cleared by fastrpc_rpmsg_remove() is also addressed.
>
> [...]

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>