From: sashiko-bot@kernel.org
To: "Vinayak Katoch" <vinayak.katoch@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] misc: fastrpc: fix NULL rpdev dereference when session alloc fails
Date: Mon, 16 Nov 2026 13:50:26 +0000 [thread overview]
Message-ID: <sashiko-outbox-217113@kernel.org> (raw)
In-Reply-To: <20261116-fastrpc-probe-fixes-v3-1-3cd56d9d9a93@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] misc: fastrpc: inaccurate Fixes trailer in
fastrpc_rpmsg_remove() fix
--
commit 29dfa1f04039615ed133d75259b0e1c7af30e157
Author: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
> misc: fastrpc: fix NULL rpdev dereference when session alloc fails
>
> When a fastrpc client process dies abnormally without closing its file
> descriptor, fastrpc_device_release() is never called and the compute-cb
> session slot is never freed. The abnormal client death on the DSP side
> triggers a glink channel teardown which propagates up through the rpmsg
> bus and calls fastrpc_rpmsg_remove().
>
> fastrpc_rpmsg_remove() nulls cctx->rpdev before calling
> misc_deregister(). If a concurrent open() enters fastrpc_device_open()
> in this window and fastrpc_session_alloc() returns NULL (sessions
> exhausted by the leaked slot), the error path dereferences
> cctx->rpdev->dev causing a NULL pointer dereference:
>
> Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
> pc : fastrpc_device_open+0x1b8/0x258 [fastrpc]
> Call trace:
> fastrpc_device_open+0x1b8/0x258 [fastrpc] (P)
> misc_open+0xd8/0x1a0
>
> Fix by moving misc_deregister() before rpdev = NULL. misc_open() and
> misc_deregister() both take misc_mtx, so misc_deregister() will either
> block until fastrpc_device_open() completes or prevent new opens from
> entering it entirely.
>
> Fixes: 7c11df42d0c7 ("misc: fastrpc: Fix device_open when no session is available")
> Cc: stable@vger.kernel.org
> Reviewed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
> Tested-by: Tyler Baker <tyler.baker@oss.qualcomm.com> # Eliza EVK, EL2
> Signed-off-by: Vinayak Katoch <vinayak.katoch@oss.qualcomm.com>
[Severity: Low]
In commit 7c11df42d0c7 ("misc: fastrpc: Fix device_open when no session is
available"), fastrpc_rpmsg_remove() did not clear cctx->rpdev at all, and when
2e369878bd43 ("misc: fastrpc: Don't reference rpmsg_device after remove")
added cctx->rpdev = NULL, it placed it after misc_deregister().
46248400d81e ("misc: fastrpc: reject new invocations during device removal")
moved cctx->rpdev = NULL ahead of misc_deregister(), introducing the race
window where fastrpc_device_open() can see a NULL cctx->rpdev.
Should the Fixes tag be:
Fixes: 46248400d81e ("misc: fastrpc: reject new invocations during device removal")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-fastrpc-probe-fixes-v3-0-3cd56d9d9a93@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-11-16 13:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:27 [PATCH v3 0/2] fastrpc: fix probe-time races between rpmsg and userspace Vinayak Katoch
2026-11-16 13:27 ` [PATCH v3 1/2] misc: fastrpc: fix NULL rpdev dereference when session alloc fails Vinayak Katoch
2026-11-16 13:50 ` sashiko-bot [this message]
2026-11-16 13:27 ` [PATCH v3 2/2] misc: fastrpc: fix init ordering race in rpmsg probe Vinayak Katoch
2026-11-16 13:51 ` sashiko-bot
2026-11-16 13:57 ` [PATCH v3 0/2] fastrpc: fix probe-time races between rpmsg and userspace Srinivas Kandagatla
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=sashiko-outbox-217113@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vinayak.katoch@oss.qualcomm.com \
/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.