# CVE-2024-38667: riscv: prevent pt_regs corruption for secondary idle threads

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/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.23%, higher than 14% of CVEs (2026-12-01)
- Published: 2024-06-24T13:52:25.399Z
- Modified: 2026-06-17T07:40:50.153Z
- Weaknesses: CWE-787
- 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: prevent pt_regs corruption for secondary idle threads

Top of the kernel thread stack should be reserved for pt_regs. However
this is not the case for the idle threads of the secondary boot harts.
Their stacks overlap with their pt_regs, so both may get corrupted.

Similar issue has been fixed for the primary hart, see c7cdd96eca28
("riscv: prevent stack corruption by reserving task_pt_regs(p) early").
However that fix was not propagated to the secondary harts. The problem
has been noticed in some CPU hotplug tests with V enabled. The function
smp_callin stored several registers on stack, corrupting top of pt_regs
structure including status field. As a result, kernel attempted to save
or restore inexistent V context.

(As written by CVE List.)

## Affected

- Linux Linux: from 2875fe0561569f82d0e63658ccf0d11ce7da8922 before ea22d4195cca13d5fdbc4d6555a2dfb8a7867a9e; from 2875fe0561569f82d0e63658ccf0d11ce7da8922 before 3090c06d50eaa91317f84bf3eac4c265e6cb8d44; from 2875fe0561569f82d0e63658ccf0d11ce7da8922 before 0c1f28c32a194303da630fca89481334b9547b80; from 2875fe0561569f82d0e63658ccf0d11ce7da8922 before a638b0461b58aa3205cd9d5f14d6f703d795b4af; 5.7 (not affected: before 5.7; from 6.1.93 up to 6.1.*; from 6.6.33 up to 6.6.*; from 6.9.4 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 5.7 before 6.1.93; from 6.2 before 6.6.33; from 6.7 before 6.9.4; 6.10

## References

- <https://git.kernel.org/stable/c/ea22d4195cca13d5fdbc4d6555a2dfb8a7867a9e> (patch)
- <https://git.kernel.org/stable/c/3090c06d50eaa91317f84bf3eac4c265e6cb8d44> (patch)
- <https://git.kernel.org/stable/c/0c1f28c32a194303da630fca89481334b9547b80> (mailing-list, patch)
- <https://git.kernel.org/stable/c/a638b0461b58aa3205cd9d5f14d6f703d795b4af> (patch)

## Sources

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

---

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