# CVE-2024-56673: riscv: mm: Do not call pmd dtor on vmemmap page table teardown

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.26% (percentile 11, 2026-11-29)
- **Published:** 2024-12-27T15:06:34.280Z
- **Modified:** 2026-06-17T08:12:42.877Z

## Who should check

- Anyone running Linux \>= c75a74f4ba19c904c0ae1e011ae2568449409ae4, \< 344945806f2f7af68be98bac02836c867f223aa9; \>= c75a74f4ba19c904c0ae1e011ae2568449409ae4, \< 21f1b85c8912262adf51707e63614a114425eb10
- Anyone running Linux 6.11

## Description

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

riscv: mm: Do not call pmd dtor on vmemmap page table teardown

The vmemmap's, which is used for RV64 with SPARSEMEM\_VMEMMAP, page
tables are populated using pmd (page middle directory) hugetables.
However, the pmd allocation is not using the generic mechanism used by
the VMA code (e.g. pmd\_alloc()), or the RISC-V specific
create\_pgd\_mapping()/alloc\_pmd\_late(). Instead, the vmemmap page table
code allocates a page, and calls vmemmap\_set\_pmd(). This results in
that the pmd ctor is \*not\* called, nor would it make sense to do so.

Now, when tearing down a vmemmap page table pmd, the cleanup code
would unconditionally, and incorrectly call the pmd dtor, which
results in a crash (best case).

This issue was found when running the HMM selftests:

  \| tools/testing/selftests/mm\# ./test\_hmm.sh smoke
  \| ... \# when unloading the test\_hmm.ko module
  \| page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10915b
  \| flags: 0x1000000000000000(node=0\|zone=1)
  \| raw: 1000000000000000 0000000000000000 dead000000000122 0000000000000000
  \| raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
  \| page dumped because: VM\_BUG\_ON\_PAGE(ptdesc-\>pmd\_huge\_pte)
  \| ------------\[ cut here \]------------
  \| kernel BUG at include/linux/mm.h:3080!
  \| Kernel BUG \[\#1\]
  \| Modules linked in: test\_hmm(-) sch\_fq\_codel fuse drm drm\_panel\_orientation\_quirks backlight dm\_mod
  \| CPU: 1 UID: 0 PID: 514 Comm: modprobe Tainted: G        W          6.12.0-00982-gf2a4f1682d07 \#2
  \| Tainted: \[W\]=WARN
  \| Hardware name: riscv-virtio qemu/qemu, BIOS 2024.10 10/01/2024
  \| epc : remove\_pgd\_mapping+0xbec/0x1070
  \|  ra : remove\_pgd\_mapping+0xbec/0x1070
  \| epc : ffffffff80010a68 ra : ffffffff80010a68 sp : ff20000000a73940
  \|  gp : ffffffff827b2d88 tp : ff6000008785da40 t0 : ffffffff80fbce04
  \|  t1 : 0720072007200720 t2 : 706d756420656761 s0 : ff20000000a73a50
  \|  s1 : ff6000008915cff8 a0 : 0000000000000039 a1 : 0000000000000008
  \|  a2 : ff600003fff0de20 a3 : 0000000000000000 a4 : 0000000000000000
  \|  a5 : 0000000000000000 a6 : c0000000ffffefff a7 : ffffffff824469b8
  \|  s2 : ff1c0000022456c0 s3 : ff1ffffffdbfffff s4 : ff6000008915c000
  \|  s5 : ff6000008915c000 s6 : ff6000008915c000 s7 : ff1ffffffdc00000
  \|  s8 : 0000000000000001 s9 : ff1ffffffdc00000 s10: ffffffff819a31f0
  \|  s11: ffffffffffffffff t3 : ffffffff8000c950 t4 : ff60000080244f00
  \|  t5 : ff60000080244000 t6 : ff20000000a73708
  \| status: 0000000200000120 badaddr: ffffffff80010a68 cause: 0000000000000003
  \| \[\<ffffffff80010a68\>\] remove\_pgd\_mapping+0xbec/0x1070
  \| \[\<ffffffff80fd238e\>\] vmemmap\_free+0x14/0x1e
  \| \[\<ffffffff8032e698\>\] section\_deactivate+0x220/0x452
  \| \[\<ffffffff8032ef7e\>\] sparse\_remove\_section+0x4a/0x58
  \| \[\<ffffffff802f8700\>\] \_\_remove\_pages+0x7e/0xba
  \| \[\<ffffffff803760d8\>\] memunmap\_pages+0x2bc/0x3fe
  \| \[\<ffffffff02a3ca28\>\] dmirror\_device\_remove\_chunks+0x2ea/0x518 \[test\_hmm\]
  \| \[\<ffffffff02a3e026\>\] hmm\_dmirror\_exit+0x3e/0x1018 \[test\_hmm\]
  \| \[\<ffffffff80102c14\>\] \_\_riscv\_sys\_delete\_module+0x15a/0x2a6
  \| \[\<ffffffff80fd020c\>\] do\_trap\_ecall\_u+0x1f2/0x266
  \| \[\<ffffffff80fde0a2\>\] \_new\_vmalloc\_restore\_context\_a0+0xc6/0xd2
  \| Code: bf51 7597 0184 8593 76a5 854a 4097 0029 80e7 2c00 (9002) 7597
  \| ---\[ end trace 0000000000000000 \]---
  \| Kernel panic - not syncing: Fatal exception in interrupt

Add a check to avoid calling the pmd dtor, if the calling context is
vmemmap\_free().

## Affected and fixed versions

- Linux: \>= c75a74f4ba19c904c0ae1e011ae2568449409ae4, \< 344945806f2f7af68be98bac02836c867f223aa9; \>= c75a74f4ba19c904c0ae1e011ae2568449409ae4, \< 21f1b85c8912262adf51707e63614a114425eb10 (cvelist)
- Linux: 6.11 (cvelist)

## Mitigation

- Upgrade Linux to 21f1b85c8912262adf51707e63614a114425eb10 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-56673. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-56673.md
Affected: Linux >= c75a74f4ba19c904c0ae1e011ae2568449409ae4, < 344945806f2f7af68be98bac02836c867f223aa9; >= c75a74f4ba19c904c0ae1e011ae2568449409ae4, < 21f1b85c8912262adf51707e63614a114425eb10; Linux 6.11
Fixed in: Linux 344945806f2f7af68be98bac02836c867f223aa9, Linux 21f1b85c8912262adf51707e63614a114425eb10

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-56673 being exploited?

There is no confirmed exploitation: CVE-2024-56673 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.26% chance of exploitation in the next 30 days (as of 2026-11-29).

### How serious is CVE-2024-56673?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-56673?

Linux \>= c75a74f4ba19c904c0ae1e011ae2568449409ae4, \< 344945806f2f7af68be98bac02836c867f223aa9; \>= c75a74f4ba19c904c0ae1e011ae2568449409ae4, \< 21f1b85c8912262adf51707e63614a114425eb10; Linux 6.11.

### Is there a fix for CVE-2024-56673?

Yes. Fixed in Linux 344945806f2f7af68be98bac02836c867f223aa9, Linux 21f1b85c8912262adf51707e63614a114425eb10. Upgrade Linux to 21f1b85c8912262adf51707e63614a114425eb10 or later.

### How do I check if I'm affected by CVE-2024-56673?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/344945806f2f7af68be98bac02836c867f223aa9>
- patch: <https://git.kernel.org/stable/c/21f1b85c8912262adf51707e63614a114425eb10>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-56673>

HTML: <https://flawdb.com/CVE-2024-56673> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-56673>
