# CVE-2026-99018: riscv: entry: gate shadow call stack reload on sstatus.SPP, not tp

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.18% (percentile 4, 2026-11-26)
- **Published:** 2026-10-23T12:20:54.888Z
- **Modified:** 2026-10-24T14:16:52.920Z

## Who should check

- Anyone running Linux \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 6639735367a7d491977e9e5e7afc50b489d81d83; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 7d1367a53137e379498eb8791295e58854378636; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 37b4401ee6fa06046446d55e97e8d11784080843; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 4d0697f192975dab5985e921989be1d85cf580e9
- Anyone running Linux 6.7

## Description

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

riscv: entry: gate shadow call stack reload on sstatus.SPP, not tp

Under CONFIG\_SHADOW\_CALL\_STACK, handle\_exception() reloads the kernel
shadow call stack pointer (gp) only when the trap came from userspace.
It made that decision with scs\_load\_current\_if\_task\_changed, which
compares the trap-time tp (read back from sscratch into s5) against the
current tp:

	beq	\\prev, tp, \_skip\_scs
	scs\_load\_current
\_skip\_scs:

tp is a user-writable register.  A user task that sets tp to the
linear-map address of its own task\_struct (&current) before trapping
makes the comparison succeed (can achieve by brute force with KASLR
enable under our test), so the kernel skips scs\_load\_current and
keeps running with the gp that userspace left in place.  Under
CONFIG\_SHADOW\_CALL\_STACK gp is the shadow call stack pointer and
load\_global\_pointer is a no-op, so the compiler-emitted
"sd ra, -8(gp)" / "ld ra, -8(gp)" in every non-leaf function then write
to, and return through, an attacker-controlled address -- an
unprivileged kernel arbitrary-write and control-flow-hijack primitive.
The poisoned gp is saved to task\_struct.scs\_sp on return, so the reload
is skipped on every subsequent entry as well.

Decide "came from userspace" from the hardware sstatus.SPP bit (already
in s1 at this point) instead of from tp, mirroring the check that
ret\_from\_exception already uses a few instructions later.  SPP is
written by hardware on trap entry and cannot be forged from U-mode.
Legitimate behaviour is unchanged: user entries (SPP=0) reload the task
shadow call stack, nested kernel entries (SPP=1) skip it.

## Affected and fixed versions

- Linux: \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 6639735367a7d491977e9e5e7afc50b489d81d83; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 7d1367a53137e379498eb8791295e58854378636; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 37b4401ee6fa06046446d55e97e8d11784080843; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 4d0697f192975dab5985e921989be1d85cf580e9 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

- Upgrade Linux to 4d0697f192975dab5985e921989be1d85cf580e9 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-99018. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-99018.md
Affected: Linux >= d1584d791a297aa8ed93503382a682a6ecfc4218, < 6639735367a7d491977e9e5e7afc50b489d81d83; >= d1584d791a297aa8ed93503382a682a6ecfc4218, < 7d1367a53137e379498eb8791295e58854378636; >= d1584d791a297aa8ed93503382a682a6ecfc4218, < 37b4401ee6fa06046446d55e97e8d11784080843; >= d1584d791a297aa8ed93503…
Fixed in: Linux 6639735367a7d491977e9e5e7afc50b489d81d83, Linux 7d1367a53137e379498eb8791295e58854378636, Linux 37b4401ee6fa06046446d55e97e8d11784080843, Linux 4d0697f192975dab5985e921989be1d85cf580e9

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-99018 being exploited?

There is no confirmed exploitation: CVE-2026-99018 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-99018?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-99018?

Linux \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 6639735367a7d491977e9e5e7afc50b489d81d83; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 7d1367a53137e379498eb8791295e58854378636; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 37b4401ee6fa06046446d55e97e8d11784080843; \>= d1584d791a297aa8ed93503382a682a6ecfc4218, \< 4d0697f192975dab5985e921989be1d85cf580e9; Linux 6.7.

### Is there a fix for CVE-2026-99018?

Yes. Fixed in Linux 6639735367a7d491977e9e5e7afc50b489d81d83, Linux 7d1367a53137e379498eb8791295e58854378636, Linux 37b4401ee6fa06046446d55e97e8d11784080843, Linux 4d0697f192975dab5985e921989be1d85cf580e9. Upgrade Linux to 4d0697f192975dab5985e921989be1d85cf580e9 or later.

### How do I check if I'm affected by CVE-2026-99018?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/6639735367a7d491977e9e5e7afc50b489d81d83>
- other: <https://git.kernel.org/stable/c/7d1367a53137e379498eb8791295e58854378636>
- other: <https://git.kernel.org/stable/c/37b4401ee6fa06046446d55e97e8d11784080843>
- other: <https://git.kernel.org/stable/c/4d0697f192975dab5985e921989be1d85cf580e9>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-99018>

HTML: <https://flawdb.com/CVE-2026-99018> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-99018>
