# CVE-2026-139320: bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit


- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 30 Nov 2026
- **Updated:** 1 Dec 2026
- **Also known as:** AZL-117055, BELL-CVE-2026-139320, DEBIAN-CVE-2026-139320, GHSA-wx88-c548-285p, UBUNTU-CVE-2026-139320

## What is CVE-2026-139320?

CVE-2026-139320 is a high-severity vulnerability in Linux, published on 30 Nov 2026. 

### Official 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.

## Which versions are affected by CVE-2026-139320?


## How do I fix CVE-2026-139320?

Upgrade to a fixed version.

## Is CVE-2026-139320 being exploited?

There is no known exploitation of CVE-2026-139320 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-139320 and fix it if it is affected.

What it is: CVE-2026-139320 is a high-severity vulnerability in Linux, published on 30 Nov 2026. 
Exploitation: There is no known exploitation of CVE-2026-139320 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-139320/ (Markdown: https://insights.sbomify.com/CVE-2026-139320/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-139320
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-139320
- OSV: https://osv.dev/vulnerability/CVE-2026-139320

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-139320/
Summaries are generated and may contain mistakes; the official description above is the record.
