diff options
| author | Yadan Fan <ydfan@suse.com> | 2026-05-25 07:04:36 +0300 |
|---|---|---|
| committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2026-06-15 13:16:12 +0300 |
| commit | 1b001b16bc88f3f7817e228acfd91ee01bdcfcce (patch) | |
| tree | 946f90540aace1c5a001caf0cdd33870ec0a9858 /include/linux | |
| parent | aeaa898780a4edb5802731e454caae6fb2ba33cb (diff) | |
| download | linux-1b001b16bc88f3f7817e228acfd91ee01bdcfcce.tar.xz | |
MIPS: mm: Fix out-of-bounds write in maar_res_walk()
maar_res_walk() uses wi->num_cfg as the index into the fixed-size
wi->cfg array, but checks whether the array is full only after it has
filled the selected entry. If walk_system_ram_range() reports more than
16 memory ranges, the overflow call writes one struct maar_config past
the end of the array before WARN_ON() prevents num_cfg from advancing.
Move the full-array check before taking the array slot and return non-zero
when the scratch array is full, so walk_system_ram_range() terminates the
walk instead of invoking the callback for further ranges.
Fixes: a5718fe8f70f ("MIPS: mm: Drop boot_mem_map")
Signed-off-by: Yadan Fan <ydfan@suse.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
