linux-brain/drivers/gpu/drm/vc4
Maxime Ripard e29126678f drm/vc4: hvs: Fix buffer overflow with the dlist handling
[ Upstream commit facd93f4285c405f9a91b05166147cb39e860666 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-17 10:35:16 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile drm/vc4: Add support for the transposer block 2018-07-07 07:54:46 +02:00
vc4_bo.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_crtc.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_debugfs.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_dpi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
vc4_drv.c drm/vc4: drv: Add error handding for bind 2020-11-10 12:37:31 +01:00
vc4_drv.h Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_dsi.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_fence.c drm/vc4: Remove unecessary dma_fence_ops 2018-07-03 13:14:10 +02:00
vc4_gem.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
vc4_hdmi.c drm/vc4/vc4_hdmi: fill ASoC card owner 2020-10-01 13:18:17 +02:00
vc4_hvs.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_irq.c drm/vc4: Allocate binner bo when starting to use the V3D 2019-05-23 17:32:21 +02:00
vc4_kms.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_packet.h
vc4_perfmon.c drm/vc4: Disable V3D interactions if the v3d component didn't probe. 2019-04-03 12:49:18 -07:00
vc4_plane.c drm/vc4: hvs: Fix buffer overflow with the dlist handling 2021-02-17 10:35:16 +01:00
vc4_qpu_defines.h
vc4_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vc4_render_cl.c drm/vc4: Make sure to emit a tile coordinates between two MSAA loads. 2019-04-01 09:33:38 -07:00
vc4_trace.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vc4_trace_points.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vc4_txp.c Merge drm/drm-fixes into drm-misc-fixes 2019-10-03 09:59:29 +02:00
vc4_v3d.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_validate.c
vc4_validate_shaders.c
vc4_vec.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00