]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/dumb-buffers: Sanitize output on errors
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 21 Aug 2025 08:17:08 +0000 (10:17 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 29 Sep 2025 11:57:43 +0000 (13:57 +0200)
commit5ae38389636d5e081c905019aa37082535173da4
treef2df92fbb051efe1fa1d276e8d1d4a6d9cb4b019
parent817b201eaf5b0e1a5615a1d3ff89a8a3fe66672d
drm/dumb-buffers: Sanitize output on errors

The ioctls MODE_CREATE_DUMB and MODE_MAP_DUMB return results into a
memory buffer supplied by user space. On errors, it is possible that
intermediate values are being returned. The exact semantics depends
on the DRM driver's implementation of these ioctls. Although this is
most-likely not a security problem in practice, avoid any uncertainty
by clearing the memory to 0 on errors.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-2-tzimmermann@suse.de
drivers/gpu/drm/drm_dumb_buffers.c