Re: [PATCH 2/2] drm/nouveau: Fix NULL pointer dereference in GET_ZCULL_INFO ioctl
From: Daniel Campos Ramos
Date: Fri Oct 02 2026 - 13:23:19 EST
Hi Jim, Lyude,
This one repeats here every time.
Setup: an RTX 3060 (GA106) passed through to a VM, kernel 7.3-rc1,
Mesa 26.1.6 (Debian testing), firmware-nvidia-gsp not installed.
nouveau probes with "gr: firmware unavailable", so nvxx_gr() is NULL.
As soon as KWin starts, Mesa's NVK asks for the zcull info and the
kernel oopses:
BUG: kernel NULL pointer dereference, address: 00000000000000f0
RIP: 0010:nouveau_abi16_ioctl_get_zcull_info+0x17/0xa0 [nouveau]
Comm: kwin_wayland
kwin_wayland dies with it, so the whole session goes, not only
acceleration.
With this patch alone the zcull oops is gone, but the next NULL
dereference follows right away, in GETPARAM with
NOUVEAU_GETPARAM_GRAPH_UNITS:
RIP: 0010:nvkm_gr_units+0x9/0x30 [nouveau]
With this patch plus Zhenhao Wan's "drm/nouveau: prevent NULL deref of
gr in GETPARAM_GRAPH_UNITS", there is no oops: KWin starts and
composites, and NVK refuses the device cleanly (vkEnumeratePhysicalDevices
returns VK_ERROR_INITIALIZATION_FAILED).
To reproduce: a Turing or newer card on nouveau without
firmware-nvidia-gsp, then start any Vulkan or zink client.
Both fixes are needed for a desktop to survive a missing firmware
package.
Whatever helped find it, the bug is real, it repeats, and the check is
the obvious one.
Disclosure: I did this testing with an AI assistant, Claude Code
(Claude Opus 5.5). It built the kernels, ran the VM and read the
traces under my direction; I checked the results on the hardware.
For this patch, tested together with Zhenhao's:
Tested-by: Daniel Campos Ramos <Capitain_Jack@xxxxxxxxx>
Daniel