{"id":"CVE-2024-35987","state":"PUBLISHED","title":"riscv: Fix loading 64-bit NOMMU kernels past the start of RAM","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: Fix loading 64-bit NOMMU kernels past the start of RAM\n\ncommit 3335068f8721 (\"riscv: Use PUD/P4D/PGD pages for the linear\nmapping\") added logic to allow using RAM below the kernel load address.\nHowever, this does not work for NOMMU, where PAGE_OFFSET is fixed to the\nkernel load address. Since that range of memory corresponds to PFNs\nbelow ARCH_PFN_OFFSET, mm initialization runs off the beginning of\nmem_map and corrupts adjacent kernel memory. Fix this by restoring the\nprevious behavior for NOMMU kernels.","publishedAt":"2024-05-20T09:47:53.717Z","updatedAt":"2026-08-05T11:31:25.006Z","severity":{"score":8.4,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3335068f87217ea59d08f462187dc856652eea15","status":"affected","lessThan":"b008e327fa570aca210f98c817757649bae56694","versionType":"git"},{"version":"3335068f87217ea59d08f462187dc856652eea15","status":"affected","lessThan":"ea6628e4e2353978af7e3b4ad4fdaab6149acf3d","versionType":"git"},{"version":"3335068f87217ea59d08f462187dc856652eea15","status":"affected","lessThan":"aea702dde7e9876fb00571a2602f25130847bf0f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/include/asm/page.h","arch/riscv/mm/init.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","versionType":"semver"},{"version":"6.6.30","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.8.9","status":"unaffected","lessThanOrEqual":"6.8.*","versionType":"semver"},{"version":"6.9","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/include/asm/page.h","arch/riscv/mm/init.c"]}],"references":["https://git.kernel.org/stable/c/b008e327fa570aca210f98c817757649bae56694","https://git.kernel.org/stable/c/ea6628e4e2353978af7e3b4ad4fdaab6149acf3d","https://git.kernel.org/stable/c/aea702dde7e9876fb00571a2602f25130847bf0f"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:30.303Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/35xxx/CVE-2024-35987.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-35987","state":"PUBLISHED","datePublished":"2024-05-20T09:47:53.717Z","dateUpdated":"2026-08-05T11:31:25.006Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-05-17T13:50:33.145Z"},"containers":{"cna":{"title":"riscv: Fix loading 64-bit NOMMU kernels past the start of RAM","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: Fix loading 64-bit NOMMU kernels past the start of RAM\n\ncommit 3335068f8721 (\"riscv: Use PUD/P4D/PGD pages for the linear\nmapping\") added logic to allow using RAM below the kernel load address.\nHowever, this does not work for NOMMU, where PAGE_OFFSET is fixed to the\nkernel load address. Since that range of memory corresponds to PFNs\nbelow ARCH_PFN_OFFSET, mm initialization runs off the beginning of\nmem_map and corrupts adjacent kernel memory. Fix this by restoring the\nprevious behavior for NOMMU kernels."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3335068f87217ea59d08f462187dc856652eea15","status":"affected","lessThan":"b008e327fa570aca210f98c817757649bae56694","versionType":"git"},{"version":"3335068f87217ea59d08f462187dc856652eea15","status":"affected","lessThan":"ea6628e4e2353978af7e3b4ad4fdaab6149acf3d","versionType":"git"},{"version":"3335068f87217ea59d08f462187dc856652eea15","status":"affected","lessThan":"aea702dde7e9876fb00571a2602f25130847bf0f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/include/asm/page.h","arch/riscv/mm/init.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","versionType":"semver"},{"version":"6.6.30","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.8.9","status":"unaffected","lessThanOrEqual":"6.8.*","versionType":"semver"},{"version":"6.9","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/riscv/include/asm/page.h","arch/riscv/mm/init.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/b008e327fa570aca210f98c817757649bae56694"},{"url":"https://git.kernel.org/stable/c/ea6628e4e2353978af7e3b4ad4fdaab6149acf3d"},{"url":"https://git.kernel.org/stable/c/aea702dde7e9876fb00571a2602f25130847bf0f"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":8.4,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The corruption occurs in `setup_bootmem()`/`free_area_init()` on the local machine's own boot path, with no network, adjacent-network, or remote-peer data anywhere in the path; anyone able to power-cycle or reset an affected RISC-V NOMMU board triggers it, and no device insertion or physical bus access is involved, so it scores L rather than P.\nAC:L - On an affected deployment (64-bit RISC-V NOMMU with RAM below the kernel load address) the failure is fully deterministic on every single boot — `min_low_pfn < ARCH_PFN_OFFSET` forces the negative `__pfn_to_page()` index unconditionally, with no race, timing window, or memory-layout grooming required.\nPR:N - The corrupting code runs during early memory-management initialization, long before userspace, login, or any credential check exists, so no account, capability, or namespace gates it.\nUI:N - Both `setup_bootmem()` and mm initialization execute autonomously as part of kernel startup; no administrator or user has to mount anything, open a device node, or take any action.\nS:U - The out-of-bounds writes and the skewed `__va`/`__pa` translation both corrupt the kernel's own memory and allocator state, remaining entirely within the kernel's security authority — no hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - Corrupted `struct page` metadata and a systematically wrong `kernel_map.va_pa_offset` make `pfn_to_page()`/`page_address()`/`virt_to_phys()` resolve to the wrong physical memory, so the page allocator can hand out pages still holding kernel data; on NOMMU there is no MMU-enforced separation to prevent a user process from reading that kernel memory.\nI:H - `__init_single_page()` writes roughly 64 bytes of page flags, refcounts, and list pointers per PFN at a negative index before `mem_map`, giving an out-of-bounds write into adjacent kernel memory, and the wrong `va_pa_offset` additionally directs DMA and linear-map writes to incorrect physical addresses.\nA:H - The commit states mm initialization \"corrupts adjacent kernel memory\"; the resulting damage to page-allocator structures plus universally wrong physical-address translation renders the system unbootable or crashes it, and recurs on every boot while the affected memory layout is present."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:31:25.006Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.6.30"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.8.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.9"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-35987","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-05-21T15:11:39.923129Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-04T17:34:49.643Z"}},{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/b008e327fa570aca210f98c817757649bae56694","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/ea6628e4e2353978af7e3b4ad4fdaab6149acf3d","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/aea702dde7e9876fb00571a2602f25130847bf0f","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-02T03:30:12.480Z"}}]}}}