Re: [PATCH] Revert "drm/nouveau: check ioctl command codes better"

From: Danilo Krummrich
Date: Tue Jul 22 2025 - 08:54:05 EST


On Tue Jul 22, 2025 at 1:58 PM CEST, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> My previous patch ended up causing a regression for the
> DRM_IOCTL_NOUVEAU_NVIF ioctl. The intention of my patch was to only
> pass ioctl commands that have the correct dir/type/nr bits into the
> nouveau_abi16_ioctl() function.
>
> This turned out to be too strict, as userspace does use at least
> write-only and write-read direction settings. Checking for both of these
> still did not fix the issue, so the best we can do for the 6.16 release
> is to revert back to what we've had since linux-3.16.
>
> This version is still fragile, but at least it is known to work with
> existing userspace. Fixing this properly requires a better understanding
> of what commands are being passed from userspace in practice, and how
> that relies on the undocumented (mis)behavior in nouveau_drm_ioctl().
>
> Fixes: e5478166dffb ("drm/nouveau: check ioctl command codes better")
> Link: https://lore.kernel.org/dri-devel/CAFrh3J85tsZRpOHQtKgNHUVnn=EG=QKBnZTRtWS8eWSc1K1xkA@xxxxxxxxxxxxxx/
> Reported-by: Satadru Pramanik <satadru@xxxxxxxxx>
> Reported-by: Chris Bainbridge <chris.bainbridge@xxxxxxxxx>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Applied to drm-misc-fixes, thanks!

[ Add Closes: tags, fix minor typo in commit message. - Danilo ]