]> git.baikalelectronics.ru Git - kernel.git/commit
drm/uapi: Validate the mode flags/type
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 15 Nov 2017 15:49:13 +0000 (17:49 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 29 Jan 2018 19:27:25 +0000 (21:27 +0200)
commit2848ce2fa8d16a525907fe92d7531ce200808adf
tree1102063decb16bda5076c8e8b664b4258344a796
parentca4a18a6c4089d9aae8db6993a2967fd1ccae944
drm/uapi: Validate the mode flags/type

Currently userspace is allowed to feed in any king of garbage in the
high bits of the mode flags/type, as are drivers when probing modes.
Reject any mode with bogus flags/type.

Hopefully this won't break any current userspace...

v2: Split the type and flags checks to separates ifs (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171115154913.23827-1-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_modes.c
include/uapi/drm/drm_mode.h