Re: [PATCH 0/3] nouveau: fix 3 null-ptr derefs

From: lyude

Date: Thu Oct 08 2026 - 18:32:44 EST


Actually - sorry for going back on a review, but before pushing these I
realized we might want to do a bit more of a concrete fix than just
these patches. Why don't we modify nvkm_gsp_rm() so that it also checks
gsp->rm, and then use coccinelle to convert as many instances of open-
coded `if (!gsp)` as we can find?

Would you be up for handling that? If not, I could just modify these
patches, update nvkm_gsp_rm(), and send out a new series with your
modified work included.

On Fri, 2026-10-02 at 12:09 -0600, Jim Cromie via B4 Relay wrote:
> These 3 patches fix NULL ptr derefs I hit while booting kernels with
> unrelated work (dynamic-debug) on a 2019 amdgpu+noueau laptop.  One
> of
> them is possibly hard to reproduce, the others are "dependable".
>
> Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
> ---
> Jim Cromie (3):
>       drm/nouveau: Fix NULL pointer dereferences in GETPARAM ioctl
>       drm/nouveau: Fix NULL pointer dereference in GET_ZCULL_INFO
> ioctl
>       drm/nouveau/gsp: Fix NULL dereference in nvkm_gsp_gcx_ready()
>
>  drivers/gpu/drm/nouveau/nouveau_abi16.c           | 27
> ++++++++++++++++++-----
>  drivers/gpu/drm/nouveau/nvkm/engine/device/user.c |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c    |  2 +-
>  3 files changed, 24 insertions(+), 7 deletions(-)
> ---
> base-commit: 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e
> change-id: 20261002-my-fixups-324d25f3bd05
>
> Best regards,