# CVE-2024-57939: riscv: Fix sleeping in invalid context in die()

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2025-01-21T12:18:08.433Z
- Modified: 2026-06-17T08:14:16.580Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

riscv: Fix sleeping in invalid context in die()

die() can be called in exception handler, and therefore cannot sleep.
However, die() takes spinlock_t which can sleep with PREEMPT_RT enabled.
That causes the following warning:

BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 285, name: mutex
preempt_count: 110001, expected: 0
RCU nest depth: 0, expected: 0
CPU: 0 UID: 0 PID: 285 Comm: mutex Not tainted 6.12.0-rc7-00022-ge19049cf7d56-dirty #234
Hardware name: riscv-virtio,qemu (DT)
Call Trace:
    dump_backtrace+0x1c/0x24
    show_stack+0x2c/0x38
    dump_stack_lvl+0x5a/0x72
    dump_stack+0x14/0x1c
    __might_resched+0x130/0x13a
    rt_spin_lock+0x2a/0x5c
    die+0x24/0x112
    do_trap_insn_illegal+0xa0/0xea
    _new_vmalloc_restore_context_a0+0xcc/0xd8
Oops - illegal instruction [#1]

Switch to use raw_spinlock_t, which does not sleep even with PREEMPT_RT
enabled.

(As written by CVE List.)

## Affected

- Linux Linux: from 76d2a0493a17d4c8ecc781366850c3c4f8e1a446 before 8c38baa03ac8e18140faf36a3b955d30cad48e74; from 76d2a0493a17d4c8ecc781366850c3c4f8e1a446 before 10c24df2e303f517fab0359392c11b6b1d553f2b; from 76d2a0493a17d4c8ecc781366850c3c4f8e1a446 before c21df31fc2a4afc02a6e56511364e9e793ea92ec; from 76d2a0493a17d4c8ecc781366850c3c4f8e1a446 before f48f060a4b36b5e96628f6c3fb1540f1e8dedb69; from 76d2a0493a17d4c8ecc781366850c3c4f8e1a446 before 76ab0afcdbe8c9685b589016ee1c0e25fe596707; from 76d2a0493a17d4c8ecc781366850c3c4f8e1a446 before 6a97f4118ac07cfdc316433f385dbdc12af5025e; 4.15 (not affected: before 4.15; from 5.10.234 up to 5.10.*; from 5.15.177 up to 5.15.*; from 6.1.125 up to 6.1.*; from 6.6.72 up to 6.6.*; from 6.12.10 up to 6.12.*; from 6.13 up to *)
- linux linux_kernel: from 4.15 before 5.10.234; from 5.11 up to 5.15.177; from 5.16 up to 6.1.125; from 6.2 up to 6.6.72; from 6.7 up to 6.12.10; 6.13

## Every score

- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/8c38baa03ac8e18140faf36a3b955d30cad48e74> (patch)
- <https://git.kernel.org/stable/c/10c24df2e303f517fab0359392c11b6b1d553f2b> (patch)
- <https://git.kernel.org/stable/c/c21df31fc2a4afc02a6e56511364e9e793ea92ec> (patch)
- <https://git.kernel.org/stable/c/f48f060a4b36b5e96628f6c3fb1540f1e8dedb69> (patch)
- <https://git.kernel.org/stable/c/76ab0afcdbe8c9685b589016ee1c0e25fe596707> (patch)
- <https://git.kernel.org/stable/c/6a97f4118ac07cfdc316433f385dbdc12af5025e> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>

## Sources

- CVE List: [CVE-2024-57939](https://www.cve.org/CVERecord?id=CVE-2024-57939), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-57939](https://nvd.nist.gov/vuln/detail/CVE-2024-57939), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-57939 · Whole record: https://cve.day/CVE-2024-57939.json · Rebuilt by cve.day 2026-11-25T22:58:51.149Z
