# CVE-2022-49001: riscv: fix race when vmap stack overflow

- Severity: High 7.0 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:H/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.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2024-10-21T20:06:15.443Z
- Modified: 2026-08-05T08:53:23.800Z
- Weaknesses: CWE-362
- 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 race when vmap stack overflow

Currently, when detecting vmap stack overflow, riscv firstly switches
to the so called shadow stack, then use this shadow stack to call the
get_overflow_stack() to get the overflow stack. However, there's
a race here if two or more harts use the same shadow stack at the same
time.

To solve this race, we introduce spin_shadow_stack atomic var, which
will be swap between its own address and 0 in atomic way, when the
var is set, it means the shadow_stack is being used; when the var
is cleared, it means the shadow_stack isn't being used.

[Palmer: Add AQ to the swap, and also some comments.]

(As written by CVE List.)

## Affected

- Linux Linux: from 31da94c25aea835ceac00575a9fd206c5a833fed before ac00301adb19df54f2eae1efc4bad7447c0156ce; from 31da94c25aea835ceac00575a9fd206c5a833fed before 879fabc5a95401d9bce357e4b1d24ae4a360a81f; from 31da94c25aea835ceac00575a9fd206c5a833fed before 7e1864332fbc1b993659eab7974da9fe8bf8c128; 5.14 (not affected: before 5.14; from 5.15.82 up to 5.15.*; from 6.0.12 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 5.14 before 5.15.82; from 5.16 before 6.0.12; 6.1

## Every score

- Linux: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/ac00301adb19df54f2eae1efc4bad7447c0156ce> (patch)
- <https://git.kernel.org/stable/c/879fabc5a95401d9bce357e4b1d24ae4a360a81f> (patch)
- <https://git.kernel.org/stable/c/7e1864332fbc1b993659eab7974da9fe8bf8c128> (patch)

## Sources

- CVE List: [CVE-2022-49001](https://www.cve.org/CVERecord?id=CVE-2022-49001), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2022-49001](https://nvd.nist.gov/vuln/detail/CVE-2022-49001), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2022-49001 · Whole record: https://cve.day/CVE-2022-49001.json · Rebuilt by cve.day 2026-11-25T22:58:20.025Z
