HIGH Introduced in 6.3
loongarch Kprobes Underflow
CVE-2026-89902
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
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.
02KernelScan AI Analysis
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.
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.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.3 | 6.12.110 | a1cb727fa27c |
| 6.18 | 6.3 | 6.18.51 | 76395109a051 |
| 6.6 | 6.3 | 6.6.157 | ff40e597d5d9 |
| 7.2 | 6.3 | 7.2.5 | c4357ebeee63 |
| mainline | 6.3 | 7.3 | 72ce4b24676e |
| cip/6.12 | 6.3 | 6.12.111-cip32 | a1cb727fa27c |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |