Files
linux/drivers/gpu/drm
Harry Wentland da48bc4461 drm/amd/display: Use krealloc_array() in dal_vector_reserve()
[Why & How]
dal_vector_reserve() computes the allocation size as
"capacity * vector->struct_size" using uint32_t arithmetic, which can
silently wrap to a small value on overflow. This would cause krealloc to
return a smaller buffer than expected, leading to heap overflows on
subsequent vector appends.

Replace krealloc() with krealloc_array() which performs an internal
overflow check and returns NULL on wrap, preventing the issue.

Fixes: 2004f45ef8 ("drm/amd/display: Use kernel alloc/free")
Assisted-by: Copilot:claude-opus-4.6
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3766856864)
Cc: stable@vger.kernel.org
2026-06-03 14:44:36 -04:00
..
2025-10-31 10:34:52 +02:00
2026-03-10 09:42:09 +08:00
2026-05-04 14:54:44 +02:00
2026-03-11 11:18:31 +01:00
2026-03-17 17:50:49 +01:00
2026-04-28 10:50:41 +02:00
2026-04-07 12:36:31 +02:00
2025-10-31 10:34:52 +02:00
2026-04-07 12:36:31 +02:00
2025-08-21 16:21:08 +02:00
2026-03-12 07:23:23 -07:00