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.
Published: 2026-10-23
Score: 7.8 High
EPSS: < 1% Very Low
KEV: No
Impact: Unprivileged kernel arbitrary write and control‑flow hijack
Action: Apply patch
AI Analysis

Impact

The vulnerability arises in the Linux kernel's handling of the shadow call stack on RISC‑V processors. When CONFIG_SHADOW_CALL_STACK is enabled, the entry routine reloads the kernel shadow call stack pointer (gp) only if the trap originates from userspace. The decision is based on a comparison of the trap‑time tp register with the current tp. Because tp is a user‑writable register, an attacker can overwrite tp with the linear‑map address of its own task_struct before a trap occurs. This causes the comparison to succeed, the kernel skips the reload, and continues execution with a gp that points to an attacker‑controlled address. The compiler‑emitted stack operations in every non‑leaf function then read and write through that address, yielding an arbitrary write primitive and allowing control‑flow hijack within the kernel. The poisoned gp is stored in the task_struct on return, so the flaw persists across subsequent entries, providing a persistent exploitation path. Based on the description, the attack vector is a local user process that manipulates the tp register before triggering a trap.

Affected Systems

Affected systems include Linux kernels running on RISC‑V hardware with CONFIG_SHADOW_CALL_STACK enabled. The issue exists in any kernel version that contains the vulnerable entry code before the patch that replaces the tp comparison with the hardware‑controlled sstatus.SPP bit. No specific version numbers are provided in the data, so all kernels containing the offending code are considered vulnerable.

Risk and Exploitability

The CVSS score is 7.8, reflecting a high severity but the EPSS score is below 1 %, indicating that active exploitation is currently uncommon. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires local user privileges and the ability to privilege‑write the tp register, so the attack path is limited to local processes. The patch enforces the use of the unforgeable sstatus.SPP bit, removing the control‑related flaw. Based on the description, it is inferred that the exploit leverages a carefully crafted userspace process that triggers a trap after setting tp, hence local user escalation.

Generated by OpenCVE AI on October 31, 2026 at 03:50 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a version that implements the sstatus.SPP based check for shadow call stack reload.
  • If an update is not immediately available, rebuild the kernel with CONFIG_SHADOW_CALL_STACK disabled to eliminate the exploit path.
  • Patch the kernel source with the commit that replaces the tp comparison with the sstatus.SPP check.

Generated by OpenCVE AI on October 31, 2026 at 03:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Ubuntu USN Ubuntu USN USN-9018-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9018-2 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9022-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9023-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9024-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9025-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9026-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9039-1 Linux kernel (Azure CVM) vulnerabilities
Ubuntu USN Ubuntu USN USN-9040-1 Linux kernel (Low Latency NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-9066-1 Linux kernel (HWE) vulnerabilities
History

Sat, 31 Oct 2026 02:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-284

Sat, 31 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-822
References
Metrics threat_severity

None

threat_severity

Important


Sat, 24 Oct 2026 18:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-284

Sat, 24 Oct 2026 16:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-284
CWE-665

Sat, 24 Oct 2026 14:15:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}


Fri, 23 Oct 2026 19:30:00 +0000

Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux

Fri, 23 Oct 2026 17:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-284
CWE-665

Fri, 23 Oct 2026 12:45:00 +0000

Type Values Removed Values Added
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.
Title riscv: entry: gate shadow call stack reload on sstatus.SPP, not tp
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-10-24T14:10:05.883Z

Reserved: 2026-09-25T10:25:14.386Z

Link: CVE-2026-99018

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-23T13:17:24.650

Modified: 2026-10-24T14:16:52.920

Link: CVE-2026-99018

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-23T12:20:54Z

Links: CVE-2026-99018 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-31T04:00:13Z

Weaknesses
  • CWE-822

    Untrusted Pointer Dereference