CVE-2026-139320
published high CVSS 3.1 · 7.8bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux960ea056561a08e2b837b2f02d22c53226414a84 to < 5a9a6eb7bad37d72867734dc69f1b99a423cd50a · 960ea056561a08e2b837b2f02d22c53226414a84 to < 5cea952976eb9b0b2dcc630dc87e207359b1292f · 960ea056561a08e2b837b2f02d22c53226414a84 to < a2c98b2a86b0f7011c9debf249208074bfb9c7f8 · 960ea056561a08e2b837b2f02d22c53226414a84 to < ee4f44e0e3c8125eebe9ac967b6984bc9253d489 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.0 (affected) · 0 to < 5.0 (unaffected · semver) · 6.12.119 through 6.12.* (unaffected · semver) · 6.18.65 through 6.18.* (unaffected · semver) · 7.3.6 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit In the branch of a BPF_JSET which is taken, the verifier can learn something about the register only if the mask has a single bit: then this bit is set. regs_refine_cond_op() tests this with is_power_of_2(val) and then ORs val into var_off. val is a u64, but is_power_of_2() takes an unsigned long. On a 32-bit kernel it only sees the lower half of the mask. For if r1 & 0xffffffff80000000 goto l which is a BPF_JSET | BPF_K with an immediate of 0x80000000, the lower half is a power of two. So the verifier takes all 33 bits for set at l, while the branch is taken if any of them is. A mask of 0x100000001 from a register does the same for bit 0. The log of an i386 kernel, for r6 = bpf_get_prandom_u32() << 31: 3: (45) if r6 & 0x80000000 goto pc+2 from 3 to 6: R6=0xffffffff80000000 R10=fp0 6: (77) r6 >>= 63 ; R6=1 When the program runs, r6 >> 63 is 0. >From then on the verifier works with known bits which the register does not have at run time. It accepts, for example, an offset into a map value which it derives from these bits and believes to be constant, and the program can access memory outside of the map value. Count the bits of the whole value. Only 32-bit kernels are affected. On a 64-bit kernel unsigned long holds the whole mask, and this patch changes nothing.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The flaw is in the BPF_JSET case of regs_refine_cond_op() (reg_set_min_max() before 6.8), which runs only while the verifier checks a program a local process passes to bpf(BPF_PROG_LOAD). No remote peer supplies the program or the JSET mask. AC:L - The loader chooses JSET imm 0x80000000 (sign-extended to 0xffffffff80000000) and the runtime value, e.g. 0x80000000 from its own packet or map. On 32-bit, is_power_of_2(unsigned long) always passes, so the verifier marks bits 31-63 set and r>>63 is verifier-1/runtime-0. There is no race or layout dependence. PR:L - In 5.10.y/5.15.y, BPF_UNPRIV_DEFAULT_OFF has no default, so sysctl_unprivileged_bpf_disabled is 0. bpf_prog_load() then accepts BPF_PROG_TYPE_SOCKET_FILTER without bpf_cap, and JSET and bpf_skb_load_bytes need no capability. 5.16+ defaults to 2 and needs CAP_BPF; the higher-severity value is taken. UI:N - The attacker loads the socket filter, attaches it to their own socket with SO_ATTACH_BPF and sends themselves the triggering packet. No other user or administrator action is involved. S:U - The verifier bypass turns into kernel memory corruption inside the same kernel security authority. No VM, IOMMU or hypervisor boundary is crossed. C:H - A scalar the verifier believes is constant differs at run time. With CAP_BPF that gives direct map-value out-of-bounds read/write. Unprivileged ptr+const ALU is rewritten to the verifier's value, but helper length arguments are not, so the stack overwrite below leads to control-flow hijack and arbitrary kernel reads. I:H - check_mem_size_reg() validates only the verifier's umax (e.g. 8 bytes at fp-8). bpf_skb_load_bytes() then memcpy()s the runtime length (e.g. 1008) of attacker packet bytes into the BPF stack, overflowing the kernel stack and its return addresses with attacker data. A:H - The out-of-bounds stack or map writes, or the err_clear memset(to, 0, len) with a large runtime len, crash the kernel. The attacker can reload and retrigger the program at will.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 960ea056561a08e2b837b2f02d22c53226414a84 to < 5a9a6eb7bad37d72867734dc69f1b99a423cd50a (affected · git)960ea056561a08e2b837b2f02d22c53226414a84 to < 5cea952976eb9b0b2dcc630dc87e207359b1292f (affected · git)960ea056561a08e2b837b2f02d22c53226414a84 to < a2c98b2a86b0f7011c9debf249208074bfb9c7f8 (affected · git)960ea056561a08e2b837b2f02d22c53226414a84 to < ee4f44e0e3c8125eebe9ac967b6984bc9253d489 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.0 (affected)0 to < 5.0 (unaffected · semver)6.12.119 through 6.12.* (unaffected · semver)6.18.65 through 6.18.* (unaffected · semver)7.3.6 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- db45ef0894624983de2509911479a78ea5e543c06ee9c27baf5692a9764c121e
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record