CVE-2025-39748
Description
In the Linux kernel, the following vulnerability has been resolved:
bpf: Forget ranges when refining tnum after JSET
Syzbot reported a kernel warning due to a range invariant violation on the following BPF program.
0: call bpf_get_netns_cookie 1: if r0 == 0 goto 2: if r0 & Oxffffffff goto
The issue is on the path where we fall through both jumps.
That path is unreachable at runtime: after insn 1, we know r0 != 0, but with the sign extension on the jset, we would only fallthrough insn 2 if r0 == 0. Unfortunately, is_branch_taken() isn't currently able to figure this out, so the verifier walks all branches. The verifier then refines the register bounds using the second condition and we end up with inconsistent bounds on this unreachable path:
1: if r0 == 0 goto r0: u64=[0x1, 0xffffffffffffffff] var_off=(0, 0xffffffffffffffff) 2: if r0 & 0xffffffff goto r0 before reg_bounds_sync: u64=[0x1, 0xffffffffffffffff] var_off=(0, 0) r0 after reg_bounds_sync: u64=[0x1, 0] var_off=(0, 0)
Improving the range refinement for JSET to cover all cases is tricky. We also don't expect many users to rely on JSET given LLVM doesn't generate those instructions. So instead of improving the range refinement for JSETs, Eduard suggested we forget the ranges whenever we're narrowing tnums after a JSET. This patch implements that approach.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel, a BPF verifier bug in JSET handling could cause inconsistent register bounds on unreachable paths, leading to a kernel warning.
Vulnerability
CVE-2025-39748 is a vulnerability in the Linux kernel's BPF verifier, specifically in the handling of JSET (jump if set) instructions. The issue arises when the verifier refines register bounds after a JSET condition, potentially creating inconsistent bounds on an unreachable path, leading to a range invariant violation and a kernel warning. The root cause is that the verifier's range refinement for JSET does not account for all cases, particularly when combined with a prior equality check.
Exploitation
To trigger this vulnerability, an attacker would need to craft a BPF program that includes a sequence of conditional jumps: first an equality check (e.g., if r0 == 0), followed by a JSET check (e.g., if r0 & 0xffffffff). The verifier incorrectly analyzes the unreachable path where both conditions are false, leading to inconsistent register bounds. This requires the ability to load and execute a BPF program, which typically requires privileged access (CAP_BPF or root). The attack surface is limited to systems where unprivileged BPF is enabled or where an attacker has already gained sufficient privileges.
Impact
An attacker exploiting this vulnerability could cause a kernel warning (WARN_ON), potentially leading to a denial of service (system crash or hang) due to the kernel's panic-on-warn behavior. The CVSS v3 score is 5.5 (Medium), indicating a moderate severity. There is no evidence of privilege escalation or data corruption beyond the denial-of-service condition.
Mitigation
The fix, implemented in Linux kernel commits [1][2][3], takes a conservative approach: instead of improving the range refinement for JSET (which is complex and rarely used by LLVM), the patch forgets the register ranges whenever the tnum (ternary number) is narrowed after a JSET. This prevents the inconsistent bounds from being propagated. Users should apply the latest stable kernel updates to address this issue.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
6591c788d16040643aa246819f01e069304442fd0c26bacd980a6b11862a76279846b9b25Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/2fd0c26bacd90ef26522bd3169000a4715bf151fnvdPatch
- git.kernel.org/stable/c/6279846b9b2532e1b04559ef8bd0dec049f29383nvdPatch
- git.kernel.org/stable/c/80a6b11862a7cfdf691e8f9faee89cfea219f098nvdPatch
- git.kernel.org/stable/c/f01e06930444cab289a8783017af9b64255bd103nvdPatch
- git.kernel.org/stable/c/0643aa2468192a4d81326e8e76543854870b1ee2nvd
- git.kernel.org/stable/c/22191359f8454b0be082c3b126f86bcbea0f1318nvd
- git.kernel.org/stable/c/591c788d16046edb0220800bf1819554af5853cenvd
- git.kernel.org/stable/c/c29dd8336236a4deb75596b52d2dd16ccc4a380dnvd
News mentions
0No linked articles in our index yet.