{"id":"CVE-2024-57945","aliases":["CVE-2024-57945"],"related":[],"kind":"vulnerability","state":"published","title":"riscv: mm: Fix the out of bound issue of vmemmap address","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: mm: Fix the out of bound issue of vmemmap address\n\nIn sparse vmemmap model, the virtual address of vmemmap is calculated as:\n((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT)).\nAnd the struct page's va can be calculated with an offset:\n(vmemmap + (pfn)).\n\nHowever, when initializing struct pages, kernel actually starts from the\nfirst page from the same section that phys_ram_base belongs to. If the\nfirst page's physical address is not (phys_ram_base >> PAGE_SHIFT), then\nwe get an va below VMEMMAP_START when calculating va for it's struct page.\n\nFor example, if phys_ram_base starts from 0x82000000 with pfn 0x82000, the\nfirst page in the same section is actually pfn 0x80000. During\ninit_unavailable_range(), we will initialize struct page for pfn 0x80000\nwith virtual address ((struct page *)VMEMMAP_START - 0x2000), which is\nbelow VMEMMAP_START as well as PCI_IO_END.\n\nThis commit fixes this bug by introducing a new variable\n'vmemmap_start_pfn' which is aligned with memory section size and using\nit to calculate vmemmap address instead of phys_ram_base.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: mm: Fix the out of bound issue of vmemmap address\n\nIn sparse vmemmap model, the virtual address of vmemmap is calculated as:\n((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT)).\nAnd the struct page's va can be calculated with an offset:\n(vmemmap + (pfn)).\n\nHowever, when initializing struct pages, kernel actually starts from the\nfirst page from the same section that phys_ram_base belongs to. If the\nfirst page's physical address is not (phys_ram_base >> PAGE_SHIFT), then\nwe get an va below VMEMMAP_START when calculating va for it's struct page.\n\nFor example, if phys_ram_base starts from 0x82000000 with pfn 0x82000, the\nfirst page in the same section is actually pfn 0x80000. During\ninit_unavailable_range(), we will initialize struct page for pfn 0x80000\nwith virtual address ((struct page *)VMEMMAP_START - 0x2000), which is\nbelow VMEMMAP_START as well as PCI_IO_END.\n\nThis commit fixes this bug by introducing a new variable\n'vmemmap_start_pfn' which is aligned with memory section size and using\nit to calculate vmemmap address instead of phys_ram_base.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: riscv: mm: Corrige el problema de salida de límites de la dirección vmemmap En el modelo vmemmap disperso, la dirección virtual de vmemmap se calcula como: ((struct page *)VMEMMAP_START - (phys_ram_base &gt;&gt; PAGE_SHIFT)). Y la va de la página de estructura se puede calcular con un desplazamiento: (vmemmap + (pfn)). Sin embargo, al inicializar las páginas de estructura, el kernel en realidad comienza desde la primera página de la misma sección a la que pertenece phys_ram_base. Si la dirección física de la primera página no es (phys_ram_base &gt;&gt; PAGE_SHIFT), obtenemos una va por debajo de VMEMMAP_START al calcular la va para su página de estructura. Por ejemplo, si phys_ram_base comienza desde 0x82000000 con pfn 0x82000, la primera página en la misma sección es en realidad pfn 0x80000. Durante init_unavailable_range(), inicializaremos struct page para pfn 0x80000 con dirección virtual ((struct page *)VMEMMAP_START - 0x2000), que está debajo de VMEMMAP_START y PCI_IO_END. Esta confirmación corrige este error al introducir una nueva variable 'vmemmap_start_pfn' que está alineada con el tamaño de la sección de memoria y la usa para calcular la dirección vmemmap en lugar de phys_ram_base.","source":"nvd"}],"published":"2025-01-21T12:18:12.548Z","modified":"2026-08-05T11:47:00.906Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"git","introduced":"8af1c121b0102041809bc137ec600d1865eaeedd","fixed":"04350304428063da6a55a8a4597d409dc69148b2","status":"affected"},{"type":"git","introduced":"8310080799b40fd9f2a8b808c657269678c149af","fixed":"92f08673d3f1893191323572f60e3c62f2e57c2f","status":"affected"},{"type":"git","introduced":"a278d5c60f21aa15d540abb2f2da6e6d795c3e6e","fixed":"a4a7ac3d266008018f05fae53060fcb331151a14","status":"affected"},{"type":"git","introduced":"a11dd49dcb9376776193e15641f84fcc1e5980c9","fixed":"d2bd51954ac8377c2f1eb1813e694788998add66","status":"affected"},{"type":"git","introduced":"a11dd49dcb9376776193e15641f84fcc1e5980c9","fixed":"f754f27e98f88428aaf6be6e00f5cbce97f62d4b","status":"affected"},{"type":"git","version":"5941a90c55d3bfba732b32208d58d997600b44ef","status":"affected"},{"type":"git","version":"2a1728c15ec4f45ed9248ae22f626541c179bfbe","status":"affected"},{"type":"semver","introduced":"5.10.212","fixed":"5.10.258","status":"affected"},{"type":"semver","introduced":"6.1.81","fixed":"6.1.140","status":"affected"},{"type":"semver","introduced":"6.6.21","fixed":"6.6.72","status":"affected"},{"type":"semver","introduced":"5.15.151","fixed":"5.16","status":"affected"},{"type":"semver","introduced":"6.7.9","fixed":"6.8","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.8","status":"unaffected"},{"type":"semver","introduced":"5.10.258","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"6.1.140","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.72","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.10","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.10.212","fixed":"5.11"},{"status":"affected","introduced":"5.15.151","fixed":"5.16"},{"status":"affected","introduced":"6.1.81","fixed":"6.1.140"},{"status":"affected","introduced":"6.6.21","fixed":"6.6.72"},{"status":"affected","introduced":"6.7.9","fixed":"6.8"},{"status":"affected","introduced":"6.8.1","fixed":"6.12.10"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/04350304428063da6a55a8a4597d409dc69148b2","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/92f08673d3f1893191323572f60e3c62f2e57c2f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a4a7ac3d266008018f05fae53060fcb331151a14","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d2bd51954ac8377c2f1eb1813e694788998add66","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f754f27e98f88428aaf6be6e00f5cbce97f62d4b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/08/msg00010.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-57945","url":"https://www.cve.org/CVERecord?id=CVE-2024-57945","licence":"CVE Terms of Use","modified":"2026-08-05T11:47:00.906Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-57945","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-57945","licence":"Public domain","modified":"2026-08-04T11:22:32.510Z"}],"updatedAt":"2026-11-25T22:58:51.152Z","epss":{"score":0.00317,"percentile":0.17059,"date":"2026-11-30T12:00:22.000Z"}}