{"id":"CVE-2026-138870","summary":"riscv: cfi: Bounds check restore token before swap","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: cfi: Bounds check restore token before swap\n\nCurrently the user-provided shadow stack restore token is not checked\nbefore being used as the address in ssamoswap.d. While an invalid\nrestore token will be caught and raise SIGSEGV, this happens after\nwriting 4 bytes of zeroes anywhere in the address space. Check that the\nrestore token is at least a valid user address before the swap to ensure\nwe do not scribble over kernel memory.","modified":"2026-12-01T07:00:32.503327799Z","published":"2026-11-30T13:25:45.456Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138870.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/34dbcdd0562461805f2fd276593517794b41e487"},{"type":"WEB","url":"https://git.kernel.org/stable/c/df333b72c0e14d6cffec72ce9a00503f12d1e28d"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138870.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138870"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"66c9c713de597f9b40a319ebda4d3466ce2cdff0"},{"fixed":"34dbcdd0562461805f2fd276593517794b41e487"},{"fixed":"df333b72c0e14d6cffec72ce9a00503f12d1e28d"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138870.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"7.0.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138870.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}