Skip to content

drm/nouveau: Fix NULL pointer dereferences in GETPARAM and GET_ZCULL_INFO ioctls

Jim Cromie dri-devel lkml nouveau sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected] change-id 20260815-null-fixes-5e9e86666a5d

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/nouveau: Fix NULL pointer dereferences in GETPARAM ioctldrivers/gpu/drm/nouveau/nouveau_abi16.c+21 -43 replies
2/2drm/nouveau: Fix NULL pointer dereference in GET_ZCULL_INFO ioctldrivers/gpu/drm/nouveau/nouveau_abi16.c+1 -12 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchDaniel Campos Ramos
1/2
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] drm/nouveau: Fix NULL pointer dereferences in GETPARAM and GET_ZCULL_INFO ioctls

When Nouveau initialization is incomplete (e.g. firmware microcode fails to load or graphics engine initialization aborts early), userspace display servers (GNOME/Mesa) probing device capabilities trigger fatal kernel NULL pointer dereferences in the Nouveau ioctl handlers.

This 2-patch series fixes two distinct NULL pointer crash paths:

1. drm/nouveau: Fix NULL pointer dereferences in GETPARAM ioctl
- Prevents NULL dereference of gr, gr->func, and nvkm_device->func in nouveau_abi16_ioctl_getparam(). Returns -ENODEV cleanly.

2. drm/nouveau: Fix NULL pointer dereference in GET_ZCULL_INFO ioctl
- Checks that gr is non-NULL before inspecting gr->has_zcull_info at

     offset 0xf0 in nouveau_abi16_ioctl_get_zcull_info().

Both bugs were reproduced and verified fixed on GA107 (NVIDIA GeForce RTX 3050 Mobile) running 7.2-rc7 under GNOME Wayland desktop initialization.

---
Jim Cromie (2):
drm/nouveau: Fix NULL pointer dereferences in GETPARAM ioctl drm/nouveau: Fix NULL pointer dereference in GET_ZCULL_INFO ioctl

 drivers/gpu/drm/nouveau/nouveau_abi16.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

---
base-commit: db2ddb87143519e20a95aa36c60b36107b736a58
change-id: 20260815-null-fixes-5e9e86666a5d

Best regards,

Signature · 1 line
Jim Cromie <[email protected]>