CVE-2026-98041 PUBLISHED

bpf: Don't predict JMP32 pointer vs zero comparisons

Assigner: Linux
Reserved: 25.09.2026 Published: 25.09.2026 Updated: 25.09.2026

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

bpf: Don't predict JMP32 pointer vs zero comparisons

Consider the following program:

<pre> r1 = map_value; /* low 32 bits are zero at runtime */ r6 = 0xdead000000000000; if w1 != 0 goto l1; l0: r1 += r6; r2 = *(u64 *)(r1 + 0); exit; l1: r6 = 0; goto l0; </pre>

At the moment is_branch_taken() reports the jump as always taken, because it does not distinguish between BPF_JMP and BPF_JMP32 comparisons when processing 'if w1 != 0 ...'.

Metrics

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

AV:L - The attacker must load a BPF program locally with bpf(BPF_PROG_LOAD). bpf_check() -> check_cond_jmp_op() -> is_branch_taken() then mispredicts a JMP32 'if wX != 0' on a pointer register. No network peer supplies any of the input. AC:H - The fall-through only diverges at runtime when the pointer's low 32 bits happen to be zero. An unprivileged attacker cannot read kernel addresses, so they cannot choose that alignment. That route also needs the non-default setting unprivileged_bpf_disabled=0 and a way past the verifier's unprivileged mitigations. PR:L - For JMP32 compares of a pointer against immediate 0, is_branch_taken() runs before the 'pointer comparison prohibited' check, so unprivileged socket-filter programs reach it when kernel.unprivileged_bpf_disabled=0. That setting is non-default on current kernels but was upstream's default on older affected kernels. Otherwise CAP_BPF in init_user_ns is required. UI:N - The attacker writes, loads and runs the BPF program themselves, for example by attaching a socket filter to their own socket and sending traffic. No other user has to act. S:U - The result is a kernel privilege escalation inside the same kernel security authority. The bug does not cross a VM or hypervisor boundary. C:H - Unverified code on the path the verifier thought unreachable can add an arbitrary scalar to a pointer the verifier believes is in bounds, for example the fix commit's r1 += r6 with r6=0xdead000000000000. The following load then reads arbitrary kernel memory. I:H - The same out-of-bounds pointer can be used as the target of a store, so the bypass gives an arbitrary kernel write and a path to code execution or credential overwrite. A:H - Dereferencing the wild pointer on the mispredicted path, such as 0xdead000000000000 in the commit's reproducer, oopses or panics the kernel.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from cac616db39c207dc63465a4e05c6ce0e60b2cce4 to d16f0eafcaa62e677a2b5b0dabc1f8d31dfe3d4d (excl.)
  • affected from cac616db39c207dc63465a4e05c6ce0e60b2cce4 to e2ae33247e8b2dbe9d116d3e61cadf6d548339c6 (excl.)
  • affected from cac616db39c207dc63465a4e05c6ce0e60b2cce4 to a4d7f94c1ca914469ced665ec2f98be669aef462 (excl.)
  • affected from cac616db39c207dc63465a4e05c6ce0e60b2cce4 to e51179a4e09846f8fd0f26a05068520de2b301bf (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.8 is affected
  • unaffected from 0 to 5.8 (excl.)
  • unaffected from 6.12.111 to 6.12.* (incl.)
  • unaffected from 6.18.53 to 6.18.* (incl.)
  • unaffected from 7.2.7 to 7.2.* (incl.)
  • unaffected from 7.3-rc2 to * (incl.)

References