# CVE-2024-56585: LoongArch: Fix sleeping in atomic context for PREEMPT\_RT

> 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 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-12-27T14:50:53.471Z
- **Modified:** 2026-06-17T08:12:28.590Z

## Who should check

- Anyone running Linux \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 08715b741f9b2a925d6485491e4907f3b29bac70; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< c5f89458a2ea0800866b9fc690d3fa8367dc8f8d; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 6575e0867bd478a5d7ef1783ca1e73160807d238; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 88fd2b70120d52c1010257d36776876941375490
- Anyone running Linux 5.19

## Description

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

LoongArch: Fix sleeping in atomic context for PREEMPT\_RT

Commit bab1c299f3945ffe79 ("LoongArch: Fix sleeping in atomic context in
setup\_tlb\_handler()") changes the gfp flag from GFP\_KERNEL to GFP\_ATOMIC
for alloc\_pages\_node(). However, for PREEMPT\_RT kernels we can still get
a "sleeping in atomic context" error:

\[    0.372259\] BUG: sleeping function called from invalid context at kernel/locking/spinlock\_rt.c:48
\[    0.372266\] in\_atomic(): 1, irqs\_disabled(): 1, non\_block: 0, pid: 0, name: swapper/1
\[    0.372268\] preempt\_count: 1, expected: 0
\[    0.372270\] RCU nest depth: 1, expected: 1
\[    0.372272\] 3 locks held by swapper/1/0:
\[    0.372274\]  \#0: 900000000c9f5e60 (&pcp-\>lock){+.+.}-{3:3}, at: get\_page\_from\_freelist+0x524/0x1c60
\[    0.372294\]  \#1: 90000000087013b8 (rcu\_read\_lock){....}-{1:3}, at: rt\_spin\_trylock+0x50/0x140
\[    0.372305\]  \#2: 900000047fffd388 (&zone-\>lock){+.+.}-{3:3}, at: \_\_rmqueue\_pcplist+0x30c/0xea0
\[    0.372314\] irq event stamp: 0
\[    0.372316\] hardirqs last  enabled at (0): \[\<0000000000000000\>\] 0x0
\[    0.372322\] hardirqs last disabled at (0): \[\<9000000005947320\>\] copy\_process+0x9c0/0x26e0
\[    0.372329\] softirqs last  enabled at (0): \[\<9000000005947320\>\] copy\_process+0x9c0/0x26e0
\[    0.372335\] softirqs last disabled at (0): \[\<0000000000000000\>\] 0x0
\[    0.372341\] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 6.12.0-rc7+ \#1891
\[    0.372346\] Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.0-prebeta9 10/21/2022
\[    0.372349\] Stack : 0000000000000089 9000000005a0db9c 90000000071519c8 9000000100388000
\[    0.372486\]         900000010038b890 0000000000000000 900000010038b898 9000000007e53788
\[    0.372492\]         900000000815bcc8 900000000815bcc0 900000010038b700 0000000000000001
\[    0.372498\]         0000000000000001 4b031894b9d6b725 00000000055ec000 9000000100338fc0
\[    0.372503\]         00000000000000c4 0000000000000001 000000000000002d 0000000000000003
\[    0.372509\]         0000000000000030 0000000000000003 00000000055ec000 0000000000000003
\[    0.372515\]         900000000806d000 9000000007e53788 00000000000000b0 0000000000000004
\[    0.372521\]         0000000000000000 0000000000000000 900000000c9f5f10 0000000000000000
\[    0.372526\]         90000000076f12d8 9000000007e53788 9000000005924778 0000000000000000
\[    0.372532\]         00000000000000b0 0000000000000004 0000000000000000 0000000000070000
\[    0.372537\]         ...
\[    0.372540\] Call Trace:
\[    0.372542\] \[\<9000000005924778\>\] show\_stack+0x38/0x180
\[    0.372548\] \[\<90000000071519c4\>\] dump\_stack\_lvl+0x94/0xe4
\[    0.372555\] \[\<900000000599b880\>\] \_\_might\_resched+0x1a0/0x260
\[    0.372561\] \[\<90000000071675cc\>\] rt\_spin\_lock+0x4c/0x140
\[    0.372565\] \[\<9000000005cbb768\>\] \_\_rmqueue\_pcplist+0x308/0xea0
\[    0.372570\] \[\<9000000005cbed84\>\] get\_page\_from\_freelist+0x564/0x1c60
\[    0.372575\] \[\<9000000005cc0d98\>\] \_\_alloc\_pages\_noprof+0x218/0x1820
\[    0.372580\] \[\<900000000593b36c\>\] tlb\_init+0x1ac/0x298
\[    0.372585\] \[\<9000000005924b74\>\] per\_cpu\_trap\_init+0x114/0x140
\[    0.372589\] \[\<9000000005921964\>\] cpu\_probe+0x4e4/0xa60
\[    0.372592\] \[\<9000000005934874\>\] start\_secondary+0x34/0xc0
\[    0.372599\] \[\<900000000715615c\>\] smpboot\_entry+0x64/0x6c

This is because in PREEMPT\_RT kernels normal spinlocks are replaced by
rt spinlocks and rt\_spin\_lock() will cause sleeping. Fix it by disabling
NUMA optimization completely for PREEMPT\_RT kernels.

## Affected and fixed versions

- Linux: \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 08715b741f9b2a925d6485491e4907f3b29bac70; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< c5f89458a2ea0800866b9fc690d3fa8367dc8f8d; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 6575e0867bd478a5d7ef1783ca1e73160807d238; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 88fd2b70120d52c1010257d36776876941375490 (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2024-56585.md
Affected: Linux >= fa96b57c149061f71a70bd6582d995f6424fbbf4, < 08715b741f9b2a925d6485491e4907f3b29bac70; >= fa96b57c149061f71a70bd6582d995f6424fbbf4, < c5f89458a2ea0800866b9fc690d3fa8367dc8f8d; >= fa96b57c149061f71a70bd6582d995f6424fbbf4, < 6575e0867bd478a5d7ef1783ca1e73160807d238; >= fa96b57c149061f71a70bd6…
Fixed in: Linux 08715b741f9b2a925d6485491e4907f3b29bac70, Linux 6575e0867bd478a5d7ef1783ca1e73160807d238, Linux 88fd2b70120d52c1010257d36776876941375490

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

There is no confirmed exploitation: CVE-2024-56585 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-56585?

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

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

Linux \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 08715b741f9b2a925d6485491e4907f3b29bac70; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< c5f89458a2ea0800866b9fc690d3fa8367dc8f8d; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 6575e0867bd478a5d7ef1783ca1e73160807d238; \>= fa96b57c149061f71a70bd6582d995f6424fbbf4, \< 88fd2b70120d52c1010257d36776876941375490; Linux 5.19.

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

Yes. Fixed in Linux 08715b741f9b2a925d6485491e4907f3b29bac70, Linux 6575e0867bd478a5d7ef1783ca1e73160807d238, Linux 88fd2b70120d52c1010257d36776876941375490. Upgrade Linux to 88fd2b70120d52c1010257d36776876941375490 or later.

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

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/08715b741f9b2a925d6485491e4907f3b29bac70>
- patch: <https://git.kernel.org/stable/c/c5f89458a2ea0800866b9fc690d3fa8367dc8f8d>
- patch: <https://git.kernel.org/stable/c/6575e0867bd478a5d7ef1783ca1e73160807d238>
- patch: <https://git.kernel.org/stable/c/88fd2b70120d52c1010257d36776876941375490>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/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-56585>

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