WSL2-Linux-Kernel/drivers/gpu/drm/vc4
Maxime Ripard facd93f428
drm/vc4: hvs: Fix buffer overflow with the dlist handling
Commit 0a038c1c29 ("drm/vc4: Move LBM creation out of
vc4_plane_mode_set()") changed the LBM allocation logic from first
allocating the LBM memory for the plane to running mode_set,
adding a gap in the LBM, and then running the dlist allocation filling
that gap.

The gap was introduced by incrementing the dlist array index, but was
never checking whether or not we were over the array length, leading
eventually to memory corruptions if we ever crossed this limit.

vc4_dlist_write had that logic though, and was reallocating a larger
dlist array when reaching the end of the buffer. Let's share the logic
between both functions.

Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Eric Anholt <eric@anholt.net>
Fixes: 0a038c1c29 ("drm/vc4: Move LBM creation out of vc4_plane_mode_set()")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210129160647.128373-1-maxime@cerno.tech
2021-02-02 17:34:08 +01:00
..
Kconfig
Makefile
vc4_bo.c
vc4_crtc.c
vc4_debugfs.c drm/vc4/vc4_debugfs: Demote non-conformant kernel-doc headers 2020-11-18 11:51:58 +01:00
vc4_dpi.c
vc4_drv.c
vc4_drv.h drm for 5.11-rc1 2020-12-14 11:07:56 -08:00
vc4_dsi.c
vc4_fence.c
vc4_gem.c
vc4_hdmi.c drm/vc4: Unify PCM card's driver_name 2021-01-18 11:03:59 +01:00
vc4_hdmi.h drm/vc4: hdmi: Disable Wifi Frequencies 2020-11-19 15:46:08 +01:00
vc4_hdmi_phy.c
vc4_hdmi_regs.h drm/vc4/vc4_hdmi_regs: Mark some data sets as __maybe_unused 2020-11-18 11:51:57 +01:00
vc4_hvs.c drm/vc4: Correct lbm size and calculation 2021-01-25 11:52:59 +01:00
vc4_irq.c
vc4_kms.c drm/vc4: kms: Don't disable the muxing of an active CRTC 2020-11-23 17:59:30 +01:00
vc4_packet.h
vc4_perfmon.c
vc4_plane.c drm/vc4: hvs: Fix buffer overflow with the dlist handling 2021-02-02 17:34:08 +01:00
vc4_qpu_defines.h
vc4_regs.h
vc4_render_cl.c
vc4_trace.h
vc4_trace_points.c
vc4_txp.c drm: Pass the full state to connectors atomic functions 2020-11-20 12:23:53 +01:00
vc4_v3d.c drm/vc4/vc4_v3d: Demote non-conformant kernel-doc headers 2020-11-18 11:51:58 +01:00
vc4_validate.c
vc4_validate_shaders.c
vc4_vec.c