of: reserved_mem: prevent OOB when too many dynamic regions are defined
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
of: reserved_mem: prevent OOB when too many dynamic regions are defined
On boot, fdt_scan_reserved_mem() saves each dynamically-placed /reserved-memory subnode into a local array of size MAX_RESERVED_REGIONS.
If the device tree defines more than MAX_RESERVED_REGIONS dynamically-placed regions, fdt_scan_reserved_mem() writes past the end of the local array.
Add a bounds check that logs an error and skips the excess regions, restoring the original behavior.
From the CVE record · Linux
During boot, the Linux kernel writes past a local array if the device tree defines more than MAX_RESERVED_REGIONS dynamically placed reserved-memory regions. Someone able to supply such a device tree could trigger the out-of-bounds write when the kernel boots.
Engineers running Linux kernels that scan device trees with dynamically placed reserved-memory regions should check whether their kernel includes the fix.