{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139320","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.927Z","datePublished":"2026-11-30T13:33:40.391Z","dateUpdated":"2026-12-01T05:42:16.169Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-01T05:42:16.169Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Look at all 64 bits of a BPF_JSET mask on 32-bit\n\nIn the branch of a BPF_JSET which is taken, the verifier can learn\nsomething about the register only if the mask has a single bit: then this\nbit is set. regs_refine_cond_op() tests this with is_power_of_2(val) and\nthen ORs val into var_off.\n\nval is a u64, but is_power_of_2() takes an unsigned long. On a 32-bit\nkernel it only sees the lower half of the mask. For\n\n\tif r1 & 0xffffffff80000000 goto l\n\nwhich is a BPF_JSET | BPF_K with an immediate of 0x80000000, the lower\nhalf is a power of two. So the verifier takes all 33 bits for set at l,\nwhile the branch is taken if any of them is. A mask of 0x100000001 from a\nregister does the same for bit 0.\n\nThe log of an i386 kernel, for r6 = bpf_get_prandom_u32() << 31:\n\n\t3: (45) if r6 & 0x80000000 goto pc+2\n\tfrom 3 to 6: R6=0xffffffff80000000 R10=fp0\n\t6: (77) r6 >>= 63                     ; R6=1\n\nWhen the program runs, r6 >> 63 is 0.\n\n>From then on the verifier works with known bits which the register does\nnot have at run time. It accepts, for example, an offset into a map value\nwhich it derives from these bits and believes to be constant, and the\nprogram can access memory outside of the map value.\n\nCount the bits of the whole value.\n\nOnly 32-bit kernels are affected. On a 64-bit kernel unsigned long holds\nthe whole mask, and this patch changes nothing."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"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.\nAC: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.\nPR: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.\nUI: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.\nS:U - The verifier bypass turns into kernel memory corruption inside the same kernel security authority. No VM, IOMMU or hypervisor boundary is crossed.\nC: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.\nI: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.\nA: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."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"],"versions":[{"version":"960ea056561a08e2b837b2f02d22c53226414a84","lessThan":"5a9a6eb7bad37d72867734dc69f1b99a423cd50a","status":"affected","versionType":"git"},{"version":"960ea056561a08e2b837b2f02d22c53226414a84","lessThan":"5cea952976eb9b0b2dcc630dc87e207359b1292f","status":"affected","versionType":"git"},{"version":"960ea056561a08e2b837b2f02d22c53226414a84","lessThan":"a2c98b2a86b0f7011c9debf249208074bfb9c7f8","status":"affected","versionType":"git"},{"version":"960ea056561a08e2b837b2f02d22c53226414a84","lessThan":"ee4f44e0e3c8125eebe9ac967b6984bc9253d489","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/verifier.c"],"versions":[{"version":"5.0","status":"affected"},{"version":"0","lessThan":"5.0","status":"unaffected","versionType":"semver"},{"version":"6.12.119","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.65","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.6","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/5a9a6eb7bad37d72867734dc69f1b99a423cd50a"},{"url":"https://git.kernel.org/stable/c/5cea952976eb9b0b2dcc630dc87e207359b1292f"},{"url":"https://git.kernel.org/stable/c/a2c98b2a86b0f7011c9debf249208074bfb9c7f8"},{"url":"https://git.kernel.org/stable/c/ee4f44e0e3c8125eebe9ac967b6984bc9253d489"}],"title":"bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit","x_generator":{"engine":"bippy-1.2.0"}}}}