# CVE-2024-26987: mm/memory-failure: fix deadlock when hugetlb\_optimize\_vmemmap is enabled

> 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.23% (percentile 9, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-05-01T05:27:34.523Z
- **Modified:** 2026-06-17T07:18:52.137Z

## Who should check

- Anyone running Linux \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 5ef7ba2799a3b5ed292b8f6407376e2c25ef002e; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 882e1180c83f5b75bae03d0ccc31ccedfe5159de; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 49955b24002dc16a0ae2e83a57a2a6c863a1845c; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 1983184c22dd84a4d95a71e5c6775c2638557dc7
- Anyone running Linux 5.18

## Description

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

mm/memory-failure: fix deadlock when hugetlb\_optimize\_vmemmap is enabled

When I did hard offline test with hugetlb pages, below deadlock occurs:

======================================================
WARNING: possible circular locking dependency detected
6.8.0-11409-gf6cef5f8c37f \#1 Not tainted
------------------------------------------------------
bash/46904 is trying to acquire lock:
ffffffffabe68910 (cpu\_hotplug\_lock){++++}-{0:0}, at: static\_key\_slow\_dec+0x16/0x60

but task is already holding lock:
ffffffffabf92ea8 (pcp\_batch\_high\_lock){+.+.}-{3:3}, at: zone\_pcp\_disable+0x16/0x40

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-\> \#1 (pcp\_batch\_high\_lock){+.+.}-{3:3}:
       \_\_mutex\_lock+0x6c/0x770
       page\_alloc\_cpu\_online+0x3c/0x70
       cpuhp\_invoke\_callback+0x397/0x5f0
       \_\_cpuhp\_invoke\_callback\_range+0x71/0xe0
       \_cpu\_up+0xeb/0x210
       cpu\_up+0x91/0xe0
       cpuhp\_bringup\_mask+0x49/0xb0
       bringup\_nonboot\_cpus+0xb7/0xe0
       smp\_init+0x25/0xa0
       kernel\_init\_freeable+0x15f/0x3e0
       kernel\_init+0x15/0x1b0
       ret\_from\_fork+0x2f/0x50
       ret\_from\_fork\_asm+0x1a/0x30

-\> \#0 (cpu\_hotplug\_lock){++++}-{0:0}:
       \_\_lock\_acquire+0x1298/0x1cd0
       lock\_acquire+0xc0/0x2b0
       cpus\_read\_lock+0x2a/0xc0
       static\_key\_slow\_dec+0x16/0x60
       \_\_hugetlb\_vmemmap\_restore\_folio+0x1b9/0x200
       dissolve\_free\_huge\_page+0x211/0x260
       \_\_page\_handle\_poison+0x45/0xc0
       memory\_failure+0x65e/0xc70
       hard\_offline\_page\_store+0x55/0xa0
       kernfs\_fop\_write\_iter+0x12c/0x1d0
       vfs\_write+0x387/0x550
       ksys\_write+0x64/0xe0
       do\_syscall\_64+0xca/0x1e0
       entry\_SYSCALL\_64\_after\_hwframe+0x6d/0x75

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(pcp\_batch\_high\_lock);
                               lock(cpu\_hotplug\_lock);
                               lock(pcp\_batch\_high\_lock);
  rlock(cpu\_hotplug\_lock);

 \*\*\* DEADLOCK \*\*\*

5 locks held by bash/46904:
 \#0: ffff98f6c3bb23f0 (sb\_writers\#5){.+.+}-{0:0}, at: ksys\_write+0x64/0xe0
 \#1: ffff98f6c328e488 (&of-\>mutex){+.+.}-{3:3}, at: kernfs\_fop\_write\_iter+0xf8/0x1d0
 \#2: ffff98ef83b31890 (kn-\>active\#113){.+.+}-{0:0}, at: kernfs\_fop\_write\_iter+0x100/0x1d0
 \#3: ffffffffabf9db48 (mf\_mutex){+.+.}-{3:3}, at: memory\_failure+0x44/0xc70
 \#4: ffffffffabf92ea8 (pcp\_batch\_high\_lock){+.+.}-{3:3}, at: zone\_pcp\_disable+0x16/0x40

stack backtrace:
CPU: 10 PID: 46904 Comm: bash Kdump: loaded Not tainted 6.8.0-11409-gf6cef5f8c37f \#1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
Call Trace:
 \<TASK\>
 dump\_stack\_lvl+0x68/0xa0
 check\_noncircular+0x129/0x140
 \_\_lock\_acquire+0x1298/0x1cd0
 lock\_acquire+0xc0/0x2b0
 cpus\_read\_lock+0x2a/0xc0
 static\_key\_slow\_dec+0x16/0x60
 \_\_hugetlb\_vmemmap\_restore\_folio+0x1b9/0x200
 dissolve\_free\_huge\_page+0x211/0x260
 \_\_page\_handle\_poison+0x45/0xc0
 memory\_failure+0x65e/0xc70
 hard\_offline\_page\_store+0x55/0xa0
 kernfs\_fop\_write\_iter+0x12c/0x1d0
 vfs\_write+0x387/0x550
 ksys\_write+0x64/0xe0
 do\_syscall\_64+0xca/0x1e0
 entry\_SYSCALL\_64\_after\_hwframe+0x6d/0x75
RIP: 0033:0x7fc862314887
Code: 10 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 \<48\> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
RSP: 002b:00007fff19311268 EFLAGS: 00000246 ORIG\_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007fc862314887
RDX: 000000000000000c RSI: 000056405645fe10 RDI: 0000000000000001
RBP: 000056405645fe10 R08: 00007fc8623d1460 R09: 000000007fffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000c
R13: 00007fc86241b780 R14: 00007fc862417600 R15: 00007fc862416a00

In short, below scene breaks the 
---truncated---

## Affected and fixed versions

- Linux: \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 5ef7ba2799a3b5ed292b8f6407376e2c25ef002e; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 882e1180c83f5b75bae03d0ccc31ccedfe5159de; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 49955b24002dc16a0ae2e83a57a2a6c863a1845c; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 1983184c22dd84a4d95a71e5c6775c2638557dc7 (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2024-26987.md
Affected: Linux >= a6b40850c442bf996e729e1d441d3dbc37cea171, < 5ef7ba2799a3b5ed292b8f6407376e2c25ef002e; >= a6b40850c442bf996e729e1d441d3dbc37cea171, < 882e1180c83f5b75bae03d0ccc31ccedfe5159de; >= a6b40850c442bf996e729e1d441d3dbc37cea171, < 49955b24002dc16a0ae2e83a57a2a6c863a1845c; >= a6b40850c442bf996e729e1…
Fixed in: Linux 5ef7ba2799a3b5ed292b8f6407376e2c25ef002e, Linux 882e1180c83f5b75bae03d0ccc31ccedfe5159de, Linux 49955b24002dc16a0ae2e83a57a2a6c863a1845c, Linux 1983184c22dd84a4d95a71e5c6775c2638557dc7

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

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

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

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

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

Linux \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 5ef7ba2799a3b5ed292b8f6407376e2c25ef002e; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 882e1180c83f5b75bae03d0ccc31ccedfe5159de; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 49955b24002dc16a0ae2e83a57a2a6c863a1845c; \>= a6b40850c442bf996e729e1d441d3dbc37cea171, \< 1983184c22dd84a4d95a71e5c6775c2638557dc7; Linux 5.18.

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

Yes. Fixed in Linux 5ef7ba2799a3b5ed292b8f6407376e2c25ef002e, Linux 882e1180c83f5b75bae03d0ccc31ccedfe5159de, Linux 49955b24002dc16a0ae2e83a57a2a6c863a1845c, Linux 1983184c22dd84a4d95a71e5c6775c2638557dc7. Upgrade Linux to 1983184c22dd84a4d95a71e5c6775c2638557dc7 or later.

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

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/5ef7ba2799a3b5ed292b8f6407376e2c25ef002e>
- patch: <https://git.kernel.org/stable/c/882e1180c83f5b75bae03d0ccc31ccedfe5159de>
- patch: <https://git.kernel.org/stable/c/49955b24002dc16a0ae2e83a57a2a6c863a1845c>
- patch: <https://git.kernel.org/stable/c/1983184c22dd84a4d95a71e5c6775c2638557dc7>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DAMSOZXJEPUOXW33WZYWCVAY7Z5S7OOY/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4EZ6PJW7VOZ224TD7N4JZNU6KV32ZJ53/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCBZZEC7L7KTWWAS2NLJK6SO3IZIL4WW/>

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

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