CVE-2024-26712: powerpc/kasan: Fix addr error caused by page alignment
In the Linux kernel, the following vulnerability has been resolved:
powerpc/kasan: Fix addr error caused by page alignment
In kasaninitregion, when kstart is not page aligned, at the begin of for loop, kcur = kstart & PAGEMASK is less than kstart, and then va = block + kcur - kstart is less than block, the addr va is invalid, because the memory address space from va to block is not alloced by memblockalloc, which will not be reserved by memblockreserve later, it will be used by other places.
As a result, memory overwriting occurs.
for example: int init weak kasaninitregion(void start, sizet size) { [...] / if say block(dcd97000) kstart(feef7400) kend(feeff3fe) / block = memblockalloc(kend - kstart, PAGESIZE); [...] for (kcur = kstart & PAGEMASK; kcur < kend; kcur += PAGESIZE) { / at the begin of for loop block(dcd97000) va(dcd96c00) kcur(feef7000) kstart(feef7400) va(dcd96c00) is less than block(dcd97000), va is invalid / void va = block + kcur - kstart; [...] } [...] }
Therefore, page alignment is performed on kstart before memblockalloc() to ensure the validity of the VA address.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
powerpc/kasan: Fix addr error caused by page alignment
The Linux kernel CVE team has assigned CVE-2024-26712 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024040342-CVE-2024-26712-d713@gregkh/T
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.10.210 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.15.149 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.1.79 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.18 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.7.6 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8 - Configuration
In kasan_init_region, align k_start to a page boundary before memblock_alloc() so that in the for-loop (k_cur = k_start & PAGE_MASK; k_cur < k_end; k_cur += PAGE_SIZE) the computed va = block + k_cur - k_start remains valid (i.e., not less than block).
Linux kernel powerpc/kasan (kasan_init_region) page alignment of k_start before memblock_alloc() = Perform page alignment on k_start prior to calling memblock_alloc()
Event History
Frequently Asked Questions
What is the severity of CVE-2024-26712?
CVE-2024-26712 is considered a vulnerability in the Linux kernel that affects memory handling, potentially leading to crashes or undefined behavior.
How do I fix CVE-2024-26712?
To mitigate CVE-2024-26712, update your Linux kernel to a version higher than 5.10.210, 5.15.149, 6.1.79, 6.6.18, 6.7.6, or any of the specified Debian kernel updates.
Which Linux kernel versions are affected by CVE-2024-26712?
CVE-2024-26712 affects various versions of the Linux kernel prior to 5.10.210, 5.15.149, 6.1.79, 6.6.18, and 6.7.6.
Is CVE-2024-26712 related to memory safety?
Yes, CVE-2024-26712 involves a memory error that can occur due to improper page alignment in the Linux kernel's KASan functionality.
What is KASan in relation to CVE-2024-26712?
KASan, or Kernel Address Sanitizer, is a memory error detection feature in the Linux kernel, and CVE-2024-26712 addresses a vulnerability within this feature.