From: sashiko-bot@kernel.org
To: "Jonathan Kuehn" <jonathan.kuehn@aol.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] GPU: drm: nouveau: Prevent kernel oops on missing firmware binary
Date: Thu, 05 Nov 2026 20:44:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-200128@kernel.org> (raw)
In-Reply-To: <20261105202757.28703-1-jonathan.kuehn@aol.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/nouveau: redundant gr NULL check in nvkm_gr_units() after caller fix
--
commit f535382c50460cf93f6d91dd265e009e3ef99a0a
Author: Jonathan Kuehn <jonathan.kuehn@aol.com>
GPU: drm: nouveau: Prevent kernel oops on missing firmware binary
This commit adds a NULL check for the gr pointer in nvkm_gr_units() to avoid
a NULL pointer dereference when querying NOUVEAU_GETPARAM_GRAPH_UNITS with
missing firmware binaries.
> GPU: drm: nouveau: Prevent kernel oops on missing firmware binary
>
> Prevent null pointer dereference at the call of
> nouveau_abi16_ioctl_getparams with parameter
> NOUVEAU_GETPARAM_GRAPH_UNITS when firmware binaries are missing.
> Fixes crash for certain user-space applications (steamwebhelper,
> signal-desktop).
>
> Signed-off-by: Jonathan Kuehn <jonathan.kuehn@aol.com>
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c
> index cd4908b1b4dff..9abeb9732406f 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/base.c
> @@ -72,7 +72,7 @@ nvkm_gr_tile(struct nvkm_engine *engine, int region, struct nvkm_fb_tile *tile)
> u64
> nvkm_gr_units(struct nvkm_gr *gr)
> {
> - if (gr->func->units)
> + if (gr && gr->func->units)
[Severity: Medium]
Can a NULL gr pointer still reach nvkm_gr_units() here?
Commit f569473c1393 ("drm/nouveau: prevent NULL deref of gr in
GETPARAM_GRAPH_UNITS") already added a NULL check in
nouveau_abi16_ioctl_getparam(), which is the sole caller of nvkm_gr_units()
in the tree:
drivers/gpu/drm/nouveau/nouveau_abi16.c:nouveau_abi16_ioctl_getparam() {
...
case NOUVEAU_GETPARAM_GRAPH_UNITS:
getparam->value = gr ? nvkm_gr_units(gr) : 0;
break;
...
}
Since nouveau_abi16_ioctl_getparam() already guards against gr being NULL when
handling NOUVEAU_GETPARAM_GRAPH_UNITS, does adding a second check in
nvkm_gr_units() without updating the caller just duplicate the check with no
change in runtime behavior?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105202757.28703-1-jonathan.kuehn@aol.com?part=1
next prev parent reply other threads:[~2026-11-05 20:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261105202757.28703-1-jonathan.kuehn.ref@aol.com>
2026-11-05 20:27 ` [PATCH] GPU: drm: nouveau: Prevent kernel oops on missing firmware binary Jonathan Kuehn
2026-11-05 20:27 ` Jonathan Kuehn
2026-11-05 20:44 ` sashiko-bot [this message]
2026-11-05 21:15 ` Jonathan Kuehn
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-200128@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathan.kuehn@aol.com \
--cc=sashiko-reviews@lists.linux.dev \
/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.