← All Advisories
Reported from OT-Advisories.com as of

Linux Kernel RISC-V Exception Handler Reloads the Shadow Call Stack Based on the Wrong Status Bit, Risking Stack Corruption

Last refreshed2026-10-25

Status: UPDATED  |  Advisory ID: CVE-2026-99018

Key Details

CVECVE-2026-99018
CVSS Score / Version
7.8 (High) / CVSS v3.1
Updated2026-10-24
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Prose
attack vector is local; attack complexity is low; privileges required is low; user interaction is none; scope is unchanged; confidentiality impact is high; integrity impact is high; availability impact is high.
Affected products
Linux Kernel
Exploitation prediction (EPSS)
0.18% probability of exploitation in the next 30 days (7% percentile) -- FIRST.org's EPSS model.

Affected Products, Subsystems & Sectors

VendorProductAffected VersionsPatch Status
LinuxLinux Kernel
SubsystemsOT Supporting Infrastructure
SectorsAll Sectors

What to Know

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. (NVD)

What to Do

Monitor Linux's web page for any future patch releases.

References

SourceReference
NVDhttps://nvd.nist.gov/vuln/detail/CVE-2026-99018
CVEhttps://www.cve.org/CVERecord?id=CVE-2026-99018
Report compilation © 2026 OT-Advisories.com  ·  CC BY 4.0  ·  Source materials remain the property of their respective publishers as cited.