CVE-2022-49001

riscv: fix race when vmap stack overflow

State
Published
Severity
7.0 High
Published
Oct 21, 2024
Updated
Aug 5, 2026
Reserved
Aug 22, 2024

Read the record on cve.org

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.]

Scores

CVSSScoreVectorSource
3.17.0 HighCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:HLinux

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 31da94c25aea835ceac00575a9fd206c5a833fed to before ac00301adb19df54f2eae1efc4bad7447c0156ceAffected
  • 31da94c25aea835ceac00575a9fd206c5a833fed to before 879fabc5a95401d9bce357e4b1d24ae4a360a81fAffected
  • 31da94c25aea835ceac00575a9fd206c5a833fed to before 7e1864332fbc1b993659eab7974da9fe8bf8c128Affected
LinuxLinux
  • 5.14Affected
  • before 5.14Not affected
  • 5.15.82 through 5.15.*Not affected
  • 6.0.12 through 6.0.*Not affected
  • 6.1 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.