CVE-2026-89902 PUBLISHED

LoongArch: Avoid preempt count underflow without probe

Assigner: Linux
Reserved: 11.09.2026 Published: 16.09.2026 Updated: 16.09.2026

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.

Metrics

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

AV:L - An unprivileged LoongArch process reaches do_bp() then kprobe_singlestep_handler() by executing break 11 (BRK_KPROBE_SSTEPBP). That is a local CPU exception path, not a network protocol, adjacent wireless/Bluetooth frame, or physical device interface. AC:L - With no kprobe running on the CPU (the normal case), break 11 always takes the unmatched preempt_enable_no_resched() path and underflows preempt_count. The attacker then calls socket() from their own SIGTRAP handler; no race or victim-controlled state is required. PR:L - do_bp() applies no capability or credential check before dispatching BRK_KPROBE_SSTEPBP. Any unprivileged local user who can run code can issue the instruction; init-namespace root and user-namespace capabilities are not required. UI:N - The attacker executes break 11 in their own process and, for the cgroup bypass, installs their own SIGTRAP handler that creates sockets. No other user must mount a filesystem, open a device, or otherwise cooperate. S:U - Preempt-count corruption and the resulting socket cgroup/BPF misattribution stay inside the host kernel's security authority. This is not a KVM/Xen guest-to-host escape or an IOMMU/DMA boundary bypass. C:H - cgroup_sk_alloc() treats the underflow as interrupt context and pins the new socket to the root cgroup, so BPF_CGROUP_INET_SOCK_CREATE and later cgroup bind/connect/egress programs on the task's cgroup do not run. In a container or Cilium-style deployment this bypasses network isolation and can expose protected services. I:H - Root-cgroup attribution skips the container's cgroup BPF socket and traffic hooks for that socket, fully bypassing that access-control policy, while the unmatched preempt_enable corrupts kernel preempt_count used for interrupt and atomic accounting. A:H - The underflow makes in_atomic() true, so the next schedule (default SIGTRAP teardown or any blocking syscall) hits BUG: scheduling while atomic and can panic the host, especially with panic_on_warn. mem_cgroup_sk_alloc() also skips container socket charging, allowing host memory exhaustion.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 6d4cc40fb5f58147defc6c0e9d86e6232fe31616 to ff40e597d5d98c0c45a4d09df8177202fac9520e (excl.)
  • affected from 6d4cc40fb5f58147defc6c0e9d86e6232fe31616 to a1cb727fa27c2d9c7859729cd90db7bc0f46957f (excl.)
  • affected from 6d4cc40fb5f58147defc6c0e9d86e6232fe31616 to 76395109a051b53860faaec96522ef08ae9e8e27 (excl.)
  • affected from 6d4cc40fb5f58147defc6c0e9d86e6232fe31616 to c4357ebeee63cb8da1446fc936573a34e68b0f71 (excl.)
  • affected from 6d4cc40fb5f58147defc6c0e9d86e6232fe31616 to 72ce4b24676e8b3b75376c4c559dd81c1ac52d5a (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.3 is affected
  • unaffected from 0 to 6.3 (excl.)
  • unaffected from 6.6.157 to 6.6.* (incl.)
  • unaffected from 6.12.110 to 6.12.* (incl.)
  • unaffected from 6.18.51 to 6.18.* (incl.)
  • unaffected from 7.2.5 to 7.2.* (incl.)
  • unaffected from 7.3-rc2 to * (incl.)

References