CVE-2024-35987 riscv: Fix loading 64-bit NOMMU kernels past the start of RAM

High 8.4 Published Updated

A memory corruption vulnerability in the Linux kernel's RISC-V NOMMU implementation allows adjacent kernel memory corruption, potentially leading to code execution or privilege escalation.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-35987?

CVE-2024-35987 is a high-severity memory corruption vulnerability in Linux kernel, published on 20 May 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

riscv: Fix loading 64-bit NOMMU kernels past the start of RAM

commit 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") added logic to allow using RAM below the kernel load address. However, this does not work for NOMMU, where PAGE_OFFSET is fixed to the kernel load address. Since that range of memory corresponds to PFNs below ARCH_PFN_OFFSET, mm initialization runs off the beginning of mem_map and corrupts adjacent kernel memory. Fix this by restoring the previous behavior for NOMMU kernels.

Which versions are affected by CVE-2024-35987?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-35987?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2024-35987 being exploited?

There is no known exploitation of CVE-2024-35987 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-35987, DEBIAN-CVE-2024-35987, GHSA-gvc6-jh6p-v6h4, UBUNTU-CVE-2024-35987.

Is CVE-2024-35987 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free