On Tue, Oct 13, 2026 at 10:04:25AM +0800, Qianhui Xu wrote:
> From: Xu Qianhui <[email protected]>
>
> _dpu_crtc_get_gc_lut() packs DPU_GAMMA_LUT_SIZE entries of the
> user-provided LUT unconditionally:
>
> for (i = 0; i < PGC_TBL_LEN; i++) {
> val_even = drm_color_lut_extract(lut[i * 2].green, 10);
> ...
>
> The DRM core validates the blob against the maximum size and the element
> size (drm_property_replace_blob_from_id() with max_size and
> expected_elem_size), but not against the exact size, so a blob that is
> shorter than DPU_GAMMA_LUT_SIZE * sizeof(struct drm_color_lut) is accepted
> and the loop reads past the end of the blob.
>
> Reject such blobs in dpu_crtc_atomic_check(). This is reachable from
> userspace on any DPU platform that exposes the GC block (SDM845, SM8650,
> SM8750, ...).
>
> Signed-off-by: Xu Qianhui <[email protected]>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
Fixes: 39a750ff5fc9 ("drm/msm/dpu: Add DSPP GC driver to provide GAMMA_LUT DRM
property")
Reviewed-by: Dmitry Baryshkov <[email protected]>
--
With best wishes
Dmitry