drm/amd/display: Bound VBIOS record-chain walk loops
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4562236b3bc0a28aeb6ee93b2d8a849a4c4e1c7c · < 0e56f460bddb397fa9a8e6faf7ae7eaa86953eb1| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
(cherry picked from commit 95700a3d660287ed657d6892f7be9ffc0e294a93)
From the CVE record · Linux
The Linux kernel’s AMD display BIOS parsers do not bound record-chain walks. A malformed VBIOS image can cause prolonged iteration at probe time and an out-of-bounds read near the image boundary. The input does not specify how an attacker could supply the image or whether authentication or user interaction is required.
Engineers running Linux kernels with AMD display support should check their kernel’s status; affected versions were not provided.