powerpc/kexec_file: Prevent kexec range truncation
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 180adfc532a83c1d74146449f7385f767d4b8059 · < fa40f9dbdd4af53e7445d9135b5b207eb8adf372| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
powerpc/kexec_file: Prevent kexec range truncation
Sashiko AI review pointed out the following issue.
The __merge_memory_ranges() function incorrectly handles overlapping memory ranges when merging them. Although sort_memory_ranges() sorts all ranges by their start address in ascending order beforehand, the merge logic remains defective in two ways:
1. It compares the current range's start against the previous element (i-1) instead of the running target index (idx)
2. It unconditionally overwrites 'ranges[idx].end' with 'ranges[i].end'.
This logic flaw leads to critical memory truncation when a larger memory range completely subsumes subsequent smaller ranges.
For example, consider a sorted input array with three ranges: Range A (idx=0): [0x1000 - 0x9000] Range B (i=1): [0x2000 - 0x5000] (completely inside Range A) Range C (i=2): [0x6000 - 0x8000] (completely inside Range A)
From the CVE record · Linux
The Linux kernel's powerpc kexec_file code can truncate overlapping memory ranges in the kexec exclude list. This could let a crash kernel overwrite active memory, causing data corruption or crashes. The input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running the Linux kernel on powerpc systems using kexec_file should check their installations; affected versions are not specified.