]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/vkms: Avoid reading beyond LUT array
authorHarry Wentland <harry.wentland@amd.com>
Wed, 8 Nov 2023 16:36:24 +0000 (11:36 -0500)
committerMelissa Wen <melissa.srw@gmail.com>
Tue, 2 Jan 2024 13:06:53 +0000 (12:06 -0100)
commit2fee84030d12d9fddfa874e4562d71761a129277
tree7b6c3651e8f72cff64a0b5465c2b14e2c0ca985e
parentffcc67cd79ff2e93fd0bdb837c99cbab6c59d38c
drm/vkms: Avoid reading beyond LUT array

When the floor LUT index (drm_fixp2int(lut_index) is the last
index of the array the ceil LUT index will point to an entry
beyond the array. Make sure we guard against it and use the
value of the floor LUT index.

v3:
 - Drop bits from commit description that didn't contribute
   anything of value

Fixes: db1f254f2cfa ("drm/vkms: Add support to 1D gamma LUT")
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Cc: Arthur Grillo <arthurgrillo@riseup.net>
Reviewed-by: Arthur Grillo <arthurgrillo@riseup.net>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231108163647.106853-6-harry.wentland@amd.com
drivers/gpu/drm/vkms/vkms_composer.c