summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2026-05-12 15:24:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-06-03 14:45:44 -0400
commitff287df16a1a58aca78b08d1f3ee09fc44da0351 (patch)
tree1fc0125e4b3bb0e1b296d919ccaf4f7db1a2bf50 /scripts
parentf0f3981c43b32cadfe373d636d9e9ca522bb3702 (diff)
drm/amd/display: Bound VBIOS record-chain walk loops
[Why & How] All record-chain walk loops in bios_parser.c and bios_parser2.c use for(;;) and only terminate on a 0xFF record_type sentinel or zero record_size. A malformed VBIOS image missing the terminator record causes unbounded iteration at probe time, potentially hundreds of thousands of iterations with record_size=1. In the final iterations near the BIOS image boundary, struct casts beyond the 2-byte header validated by GET_IMAGE can also read out of bounds. Cap all 14 record-chain walk loops to BIOS_MAX_NUM_RECORD (256) iterations. The atombios.h defines up to 22 distinct record types and atomfirmware.h has 13. Assuming an average of less than 10 records per type (which is reasonable since most are connector- based) 256 is a generous upper bound. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Assisted-by: Copilot:claude-opus-4.6 Mythos 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 95700a3d660287ed657d6892f7be9ffc0e294a93) Cc: stable@vger.kernel.org
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions