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

riscv: probes: save original sp in rethook trampoline

Reading a word from the stack in a kretprobe crashes a risc-v kernel.

$ cd /sys/kernel/tracing/
$ echo 'r n_tty_write $stack0' > dynamic_events
$ echo 1 > events/kprobes/enable
Unable to handle kernel paging request at virtual address 0000000200000128
...
[<ffffffff80016d16>] regs_get_kernel_stack_nth+0x26/0x38
[<ffffffff80177196>] process_fetch_insn+0x3ee/0x760
[<ffffffff80177836>] kretprobe_trace_func+0x116/0x1f0
[<ffffffff8017795a>] kretprobe_dispatcher+0x4a/0x58
[<ffffffff8013572e>] kretprobe_rethook_handler+0x5e/0x90
[<ffffffff80180838>] rethook_trampoline_handler+0x70/0x108
[<ffffffff8001ba32>] arch_rethook_trampoline_callback+0x12/0x1c
[<ffffffff8001ba84>] arch_rethook_trampoline+0x48/0x94
[<ffffffff8067872a>] tty_write+0x1a/0x30

In regs_get_kernel_stack_nth, regs->sp contains an arbitrary value.

arch_rethook_trampoline saves the registers from the probed function in a
struct pt_regs. sp is not saved. Instead, sp is decremented for
arch_rethook_trampoline's local stack.

Fix this crash and save the original sp along with the other registers.
Use a0 as a temporary register, it is overwritten anyway.

[pjw@kernel.org: added Fixes tag; cc'ed stable]
Published: 2026-08-15
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

This issue arises when a kretprobe attempts to read the kernel stack on a RISC‑V system. The rethook trampoline does not preserve the original stack pointer, so regs->sp contains an arbitrary value. A subsequent stack access causes a fault, leading to a kernel panic. The vulnerability results in a denial‑of‑service condition that can affect any process running on the affected system.

Affected Systems

All Linux kernels that execute the RISC‑V rethook trampoline before the fix, including any RISC‑V target running a kernel that implements dynamic kretprobes. The patch applies to the mainline Linux kernel repository; older kernels lacking the commit are vulnerable.

Risk and Exploitability

The vulnerability requires the ability to enable a kretprobe that reads the stack, such as writing to /sys/kernel/tracing/dynamic_events. An attacker with kernel‑level privileges, or one that can configure tracing, could trigger the crash. The EPSS score is < 1% and the CVSS score is 5.5, indicating a moderate risk. The flaw can cause a full kernel panic, making it a denial‑of‑service condition. It is not listed in CISA KEV. The attack vector is likely local or remote with sufficient privilege to control kprobe configuration.

Generated by OpenCVE AI on August 18, 2026 at 01:37 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply a kernel update that includes the rethook stack pointer preservation patch (commit 2faf0198168d2017cb528a79f76c560fda3b6e94).
  • If an immediate kernel upgrade is not feasible, disable kretprobes that read the stack or stop writing to /sys/kernel/tracing/dynamic_events.
  • As a temporary safeguard, avoid using the $stack0 field in kretprobe events; switch to non‑stack‑dependent tracing methods or block dynamic_events access.

Generated by OpenCVE AI on August 18, 2026 at 01:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 18 Aug 2026 00:15:00 +0000

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

None

cvssV3_1

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

threat_severity

Moderate


Sat, 15 Aug 2026 21:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-788

Sat, 15 Aug 2026 06:00:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: riscv: probes: save original sp in rethook trampoline Reading a word from the stack in a kretprobe crashes a risc-v kernel. $ cd /sys/kernel/tracing/ $ echo 'r n_tty_write $stack0' > dynamic_events $ echo 1 > events/kprobes/enable Unable to handle kernel paging request at virtual address 0000000200000128 ... [<ffffffff80016d16>] regs_get_kernel_stack_nth+0x26/0x38 [<ffffffff80177196>] process_fetch_insn+0x3ee/0x760 [<ffffffff80177836>] kretprobe_trace_func+0x116/0x1f0 [<ffffffff8017795a>] kretprobe_dispatcher+0x4a/0x58 [<ffffffff8013572e>] kretprobe_rethook_handler+0x5e/0x90 [<ffffffff80180838>] rethook_trampoline_handler+0x70/0x108 [<ffffffff8001ba32>] arch_rethook_trampoline_callback+0x12/0x1c [<ffffffff8001ba84>] arch_rethook_trampoline+0x48/0x94 [<ffffffff8067872a>] tty_write+0x1a/0x30 In regs_get_kernel_stack_nth, regs->sp contains an arbitrary value. arch_rethook_trampoline saves the registers from the probed function in a struct pt_regs. sp is not saved. Instead, sp is decremented for arch_rethook_trampoline's local stack. Fix this crash and save the original sp along with the other registers. Use a0 as a temporary register, it is overwritten anyway. [pjw@kernel.org: added Fixes tag; cc'ed stable]
Title riscv: probes: save original sp in rethook trampoline
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 Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-08-17T05:06:52.840Z

Reserved: 2026-08-09T03:40:39.901Z

Link: CVE-2026-72028

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-15T06:21:01.953

Modified: 2026-08-17T06:18:00.533

Link: CVE-2026-72028

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-15T00:00:00Z

Links: CVE-2026-72028 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-18T01:45:05Z

Weaknesses
  • CWE-788

    Access of Memory Location After End of Buffer

  • CWE-824

    Access of Uninitialized Pointer