# CVE-2024-39298: mm/memory-failure: fix handling of dissolved but not taken off from buddy pages

> 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, NVD) `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.31% (percentile 16, 2026-11-26)
- **Published:** 2024-06-25T14:22:40.887Z
- **Modified:** 2026-06-17T07:41:39.963Z

## Who should check

- Anyone running Linux \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 00b0752c7f15dfdf129cacc6a27d61c54141182b; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< bb9bb13ce64cc7cae47f5e2ab9ce93b7bfa0117e; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 41cd2de3c95020b7f86a3cb5fab42fbf454a63bd; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 8cf360b9d6a840700e06864236a01a883b34bbad
- Anyone running Linux 6.0

## Description

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

mm/memory-failure: fix handling of dissolved but not taken off from buddy pages

When I did memory failure tests recently, below panic occurs:

page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8cee00
flags: 0x6fffe0000000000(node=1\|zone=2\|lastcpupid=0x7fff)
raw: 06fffe0000000000 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000009 00000000ffffffff 0000000000000000
page dumped because: VM\_BUG\_ON\_PAGE(!PageBuddy(page))
------------\[ cut here \]------------
kernel BUG at include/linux/page-flags.h:1009!
invalid opcode: 0000 \[\#1\] PREEMPT SMP NOPTI
RIP: 0010:\_\_del\_page\_from\_free\_list+0x151/0x180
RSP: 0018:ffffa49c90437998 EFLAGS: 00000046
RAX: 0000000000000035 RBX: 0000000000000009 RCX: ffff8dd8dfd1c9c8
RDX: 0000000000000000 RSI: 0000000000000027 RDI: ffff8dd8dfd1c9c0
RBP: ffffd901233b8000 R08: ffffffffab5511f8 R09: 0000000000008c69
R10: 0000000000003c15 R11: ffffffffab5511f8 R12: ffff8dd8fffc0c80
R13: 0000000000000001 R14: ffff8dd8fffc0c80 R15: 0000000000000009
FS:  00007ff916304740(0000) GS:ffff8dd8dfd00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055eae50124c8 CR3: 00000008479e0000 CR4: 00000000000006f0
Call Trace:
 \<TASK\>
 \_\_rmqueue\_pcplist+0x23b/0x520
 get\_page\_from\_freelist+0x26b/0xe40
 \_\_alloc\_pages\_noprof+0x113/0x1120
 \_\_folio\_alloc\_noprof+0x11/0xb0
 alloc\_buddy\_hugetlb\_folio.isra.0+0x5a/0x130
 \_\_alloc\_fresh\_hugetlb\_folio+0xe7/0x140
 alloc\_pool\_huge\_folio+0x68/0x100
 set\_max\_huge\_pages+0x13d/0x340
 hugetlb\_sysctl\_handler\_common+0xe8/0x110
 proc\_sys\_call\_handler+0x194/0x280
 vfs\_write+0x387/0x550
 ksys\_write+0x64/0xe0
 do\_syscall\_64+0xc2/0x1d0
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
RIP: 0033:0x7ff916114887
RSP: 002b:00007ffec8a2fd78 EFLAGS: 00000246 ORIG\_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055eae500e350 RCX: 00007ff916114887
RDX: 0000000000000004 RSI: 000055eae500e390 RDI: 0000000000000003
RBP: 000055eae50104c0 R08: 0000000000000000 R09: 000055eae50104c0
R10: 0000000000000077 R11: 0000000000000246 R12: 0000000000000004
R13: 0000000000000004 R14: 00007ff916216b80 R15: 00007ff916216a00
 \</TASK\>
Modules linked in: mce\_inject hwpoison\_inject
---\[ end trace 0000000000000000 \]---

And before the panic, there had an warning about bad page state:

BUG: Bad page state in process page-types  pfn:8cee00
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8cee00
flags: 0x6fffe0000000000(node=1\|zone=2\|lastcpupid=0x7fff)
page\_type: 0xffffff7f(buddy)
raw: 06fffe0000000000 ffffd901241c0008 ffffd901240f8008 0000000000000000
raw: 0000000000000000 0000000000000009 00000000ffffff7f 0000000000000000
page dumped because: nonzero mapcount
Modules linked in: mce\_inject hwpoison\_inject
CPU: 8 PID: 154211 Comm: page-types Not tainted 6.9.0-rc4-00499-g5544ec3178e2-dirty \#22
Call Trace:
 \<TASK\>
 dump\_stack\_lvl+0x83/0xa0
 bad\_page+0x63/0xf0
 free\_unref\_page+0x36e/0x5c0
 unpoison\_memory+0x50b/0x630
 simple\_attr\_write\_xsigned.constprop.0.isra.0+0xb3/0x110
 debugfs\_attr\_write+0x42/0x60
 full\_proxy\_write+0x5b/0x80
 vfs\_write+0xcd/0x550
 ksys\_write+0x64/0xe0
 do\_syscall\_64+0xc2/0x1d0
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
RIP: 0033:0x7f189a514887
RSP: 002b:00007ffdcd899718 EFLAGS: 00000246 ORIG\_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f189a514887
RDX: 0000000000000009 RSI: 00007ffdcd899730 RDI: 0000000000000003
RBP: 00007ffdcd8997a0 R08: 0000000000000000 R09: 00007ffdcd8994b2
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdcda199a8
R13: 0000000000404af1 R14: 000000000040ad78 R15: 00007f189a7a5040
 \</TASK\>

The root cause should be the below race:

 memory\_failure
  try\_memory\_failure\_hugetlb
   me\_huge\_page
    \_\_page\_handle\_poison
     dissolve\_free\_hugetlb\_folio
     drain\_all\_pages -- Buddy page can be isolated e.g. for compaction.
     take\_page\_off\_buddy -- Failed as page is not in the 
---truncated---

## Affected and fixed versions

- Linux: \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 00b0752c7f15dfdf129cacc6a27d61c54141182b; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< bb9bb13ce64cc7cae47f5e2ab9ce93b7bfa0117e; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 41cd2de3c95020b7f86a3cb5fab42fbf454a63bd; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 8cf360b9d6a840700e06864236a01a883b34bbad (cvelist)
- Linux: 6.0 (cvelist)

## Mitigation

- Upgrade Linux to 8cf360b9d6a840700e06864236a01a883b34bbad 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-39298. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-39298.md
Affected: Linux >= ceaf8fbea79a854373b9fc03c9fde98eb8712725, < 00b0752c7f15dfdf129cacc6a27d61c54141182b; >= ceaf8fbea79a854373b9fc03c9fde98eb8712725, < bb9bb13ce64cc7cae47f5e2ab9ce93b7bfa0117e; >= ceaf8fbea79a854373b9fc03c9fde98eb8712725, < 41cd2de3c95020b7f86a3cb5fab42fbf454a63bd; >= ceaf8fbea79a854373b9fc0…
Fixed in: Linux 00b0752c7f15dfdf129cacc6a27d61c54141182b, Linux 41cd2de3c95020b7f86a3cb5fab42fbf454a63bd, Linux 8cf360b9d6a840700e06864236a01a883b34bbad

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-39298 being exploited?

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

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

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

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

Linux \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 00b0752c7f15dfdf129cacc6a27d61c54141182b; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< bb9bb13ce64cc7cae47f5e2ab9ce93b7bfa0117e; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 41cd2de3c95020b7f86a3cb5fab42fbf454a63bd; \>= ceaf8fbea79a854373b9fc03c9fde98eb8712725, \< 8cf360b9d6a840700e06864236a01a883b34bbad; Linux 6.0.

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

Yes. Fixed in Linux 00b0752c7f15dfdf129cacc6a27d61c54141182b, Linux 41cd2de3c95020b7f86a3cb5fab42fbf454a63bd, Linux 8cf360b9d6a840700e06864236a01a883b34bbad. Upgrade Linux to 8cf360b9d6a840700e06864236a01a883b34bbad or later.

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

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/00b0752c7f15dfdf129cacc6a27d61c54141182b>
- patch: <https://git.kernel.org/stable/c/bb9bb13ce64cc7cae47f5e2ab9ce93b7bfa0117e>
- patch: <https://git.kernel.org/stable/c/41cd2de3c95020b7f86a3cb5fab42fbf454a63bd>
- patch: <https://git.kernel.org/stable/c/8cf360b9d6a840700e06864236a01a883b34bbad>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## 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-39298>

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