KernelScan.io

HIGH Introduced in 6.3

loongarch Kprobes Underflow

CVE-2026-89902

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.8HIGH

01

In the Linux kernel, the following vulnerability has been resolved: LoongArch: Avoid preempt count underflow without probe LoongArch uses break 11 for the breakpoint placed after an instruction that Kprobes executes out of line. Since userspace can issue the same break instruction, do_bp() can reach kprobe_singlestep_handler() when there is no current probe. The handler actually returns false in this case, but it first calls preempt_enable_no_resched(). The corresponding preempt_disable() is done by kprobe_breakpoint_handler() on a real Kprobe hit, so it has not run here. As a result, an ordinary userspace breakpoint (code 11) underflows the current task's preempt count. This also makes in_interrupt() return true until the task schedules. One visible consequence is the socket cgroup attribution: cgroup_sk_alloc() treats the allocation as interrupt context and assigns the socket to the root cgroup. A socket opened from the SIGTRAP handler can then avoid a BPF_CGROUP_INET_SOCK_CREATE policy attached to the task's own cgroup. Return as soon as kprobe_running() reports no active probe. The same check has appeared in [PATCH v10 2/4] of the original LoongArch Kprobes series, but was dropped before the feature reached mainline.

02

Engine v0.6.0

Risk summary

A local unprivileged user on a LoongArch system can issue a breakpoint instruction that reaches the kprobe single-step handler without an active probe, underflowing the preempt count and causing in_interrupt() to return true. This state persists until the task schedules and can be leveraged to bypass cgroup-based BPF socket-creation policies, and may cause further kernel state corruption.

Affectedarch/loongarch/kernel/kprobes.c (LoongArch kprobes)

Vulnerability analysis

On LoongArch systems, an ordinary userspace breakpoint instruction can reach the kernel's probe step code because the architecture uses the same break code for both user breakpoints and kernel probe single-stepping. When no probe is active, that code enables preemption without the matching disable ever having run, underflowing the task's preempt count. This tricks the kernel into thinking the task is in interrupt context until it next schedules. One demonstrated effect is that sockets created from the resulting trap handler are assigned to the root cgroup instead of the task's own, letting the process bypass a cgroup-based BPF socket policy. The correction exits early when no probe is active, preventing the unbalanced preemption change. Any unprivileged local user on a LoongArch machine with probe support can trigger the flaw by executing the breakpoint instruction.

03

BranchIntroducedFixed inPatch commit
6.126.36.12.110a1cb727fa27c
6.186.36.18.5176395109a051
6.66.36.6.157ff40e597d5d9
7.26.37.2.5c4357ebeee63
mainline6.37.372ce4b24676e
cip/6.126.36.12.111-cip32a1cb727fa27c

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32