]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/nouveau: check ioctl command codes better
authorArnd Bergmann <arnd@arndb.de>
Fri, 11 Jul 2025 07:24:53 +0000 (09:24 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 11 Jul 2025 18:04:32 +0000 (20:04 +0200)
commite5478166dffb51fa64e76cdbb5c24421f22f2d43
treed87e798f2ca83e775e4e08b4e35d09536a7e3992
parentbd46cece51a36ef088f22ef0416ac13b0a46d5b0
drm/nouveau: check ioctl command codes better

nouveau_drm_ioctl() only checks the _IOC_NR() bits in the
DRM_NOUVEAU_NVIF command, but ignores the type and direction bits, so any
command with '7' in the low eight bits gets passed into
nouveau_abi16_ioctl() instead of drm_ioctl().

Check for all the bits except the size that is handled inside of the
handler.

Fixes: 27111a23d01c ("drm/nouveau: expose the full object/event interfaces to userspace")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[ Fix up two checkpatch warnings and a typo. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250711072458.2665325-1-arnd@kernel.org
drivers/gpu/drm/nouveau/nouveau_drm.c