CVE-2024-57945
Severity CVSS v4.0:
Pending analysis
Type:
CWE-125
Out-of-bounds Read
Publication date:
21/01/2025
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
riscv: mm: Fix the out of bound issue of vmemmap address<br />
<br />
In sparse vmemmap model, the virtual address of vmemmap is calculated as:<br />
((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT)).<br />
And the struct page&#39;s va can be calculated with an offset:<br />
(vmemmap + (pfn)).<br />
<br />
However, when initializing struct pages, kernel actually starts from the<br />
first page from the same section that phys_ram_base belongs to. If the<br />
first page&#39;s physical address is not (phys_ram_base >> PAGE_SHIFT), then<br />
we get an va below VMEMMAP_START when calculating va for it&#39;s struct page.<br />
<br />
For example, if phys_ram_base starts from 0x82000000 with pfn 0x82000, the<br />
first page in the same section is actually pfn 0x80000. During<br />
init_unavailable_range(), we will initialize struct page for pfn 0x80000<br />
with virtual address ((struct page *)VMEMMAP_START - 0x2000), which is<br />
below VMEMMAP_START as well as PCI_IO_END.<br />
<br />
This commit fixes this bug by introducing a new variable<br />
&#39;vmemmap_start_pfn&#39; which is aligned with memory section size and using<br />
it to calculate vmemmap address instead of phys_ram_base.
Impact
Base Score 3.x
7.10
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.10.212 (including) | 5.11 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.15.151 (including) | 5.16 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.1.81 (including) | 6.1.140 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.6.21 (including) | 6.6.72 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7.9 (including) | 6.8 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.8.1 (including) | 6.12.10 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.8:-:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.8:rc7:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/92f08673d3f1893191323572f60e3c62f2e57c2f
- https://git.kernel.org/stable/c/a4a7ac3d266008018f05fae53060fcb331151a14
- https://git.kernel.org/stable/c/d2bd51954ac8377c2f1eb1813e694788998add66
- https://git.kernel.org/stable/c/f754f27e98f88428aaf6be6e00f5cbce97f62d4b
- https://lists.debian.org/debian-lts-announce/2025/08/msg00010.html



