# CVE-2026-138870: riscv: cfi: Bounds check restore token before swap

- 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.15%, higher than 4% of CVEs (2026-12-01)
- Published: 2026-11-30T13:25:45.456Z
- Modified: 2026-12-01T06:17:29.330Z
- Assigned by: Linux

## Description

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

riscv: cfi: Bounds check restore token before swap

Currently the user-provided shadow stack restore token is not checked
before being used as the address in ssamoswap.d. While an invalid
restore token will be caught and raise SIGSEGV, this happens after
writing 4 bytes of zeroes anywhere in the address space. Check that the
restore token is at least a valid user address before the swap to ensure
we do not scribble over kernel memory.

(As written by CVE List.)

## Affected

- Linux Linux: from 66c9c713de597f9b40a319ebda4d3466ce2cdff0 before 34dbcdd0562461805f2fd276593517794b41e487; from 66c9c713de597f9b40a319ebda4d3466ce2cdff0 before df333b72c0e14d6cffec72ce9a00503f12d1e28d; 7.0 (not affected: before 7.0; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/34dbcdd0562461805f2fd276593517794b41e487>
- <https://git.kernel.org/stable/c/df333b72c0e14d6cffec72ce9a00503f12d1e28d>

## Sources

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

---

Page: https://cve.day/CVE-2026-138870 · Whole record: https://cve.day/CVE-2026-138870.json · Rebuilt by cve.day 2026-12-01T06:32:14.403Z
