drm/fb-helper: fix input validation gaps in check_var
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Apr 2023 19:40:38 +0000 (21:40 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 5 Apr 2023 20:43:08 +0000 (22:43 +0200)
commitee4cce0a8f03a3332ccf48ef8b420a65d02d1fcf
tree10bf9c7c5f7006630cfc2a08ddc830b0b0181c38
parent36e239b5d509c1b564669e7ca3d016c444bbf808
drm/fb-helper: fix input validation gaps in check_var

Apparently drivers need to check all this stuff themselves, which for
most things makes sense I guess. And for everything else we luck out,
because modern distros stopped supporting any other fbdev drivers than
drm ones and I really don't want to argue anymore about who needs to
check stuff. Therefore fixing all this just for drm fbdev emulation is
good enough.

Note that var->active is not set or validated. This is just control
flow for fbmem.c and needs to be validated in there as needed.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230404194038.472803-3-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_fb_helper.c