KernelScan.io

HIGH Introduced in 5.16

bpf BloomFilter Overflow

CVE-2026-89579

CVSS 7.8 / 10.0 NVD

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

KernelScan AI7.7HIGH

01

In the Linux kernel, the following vulnerability has been resolved: bpf: Harden bloom filter sizing and indexing on 32-bit kernels bloom_map_alloc() has two 32-bit-specific problems when the computed bitmap reaches the U32_MAX fallback case. First, BITS_TO_BYTES(U32_MAX) is evaluated with 32-bit arithmetic. The addition performed by DIV_ROUND_UP wraps, so the map allocates only the fixed-size bloom filter object while keeping bitset_mask == U32_MAX. Subsequent updates can then write past the allocated object. Second, fixing only the allocation size is not sufficient. The bloom hash is a u32, but set_bit() takes a signed long bit number and x86 test_bit() eventually feeds the index to variable_test_bit(long, ...). On 32-bit kernels, hashes in [0x80000000, U32_MAX] therefore become negative bit offsets. x86 bt/bts with a memory operand interpret those offsets relative to the supplied base, so a map with bitset_mask == U32_MAX can read or write before bloom->bitset even after allocating the full 512 MiB bitmap. Keep the U32_MAX fallback, but split each hash into a word pointer and an in-word bit number before calling test_bit() or set_bit(). The bitops argument is then always in [0, BITS_PER_LONG - 1], while BIT_WORD(h) still selects the intended word in the full bitmap. Compute the bitset size from (u64)bitset_mask + 1 before passing the final size to bpf_map_area_alloc(). This fixes the original under-allocation and keeps the allocated storage consistent with the addressable bitset. Exploitation note: local privilege escalation is possible on a 32-bit x86 kernel using the under-allocation bug from a binary with CAP_BPF.

02

Engine v0.6.0

Risk summary

A local attacker with CAP_BPF on a 32-bit x86 kernel can trigger an integer overflow in the BPF bloom filter map allocation, causing the bitmap to be severely under-allocated while the filter believes it spans up to 4 billion bits. Subsequent insert operations write past the allocated object, enabling heap corruption and local privilege escalation to kernel level.

Affectedkernel/bpf/bloom_filter.c (BPF bloom filter map)

Vulnerability analysis

On 32-bit kernels, the bloom filter map allocation computes the bitmap size using 32-bit arithmetic that wraps around when the bit count reaches the maximum fallback, so only a tiny fixed-size object is allocated while the internal bit mask still covers the full 32-bit range. Every subsequent element insertion then writes past the end of that object, corrupting adjacent kernel heap memory. A second related issue is that the bit index passed to the kernel's bit manipulation operations is treated as a signed value on 32-bit x86, so hash values above the signed integer maximum are interpreted as negative offsets, causing reads and writes before the bitmap base. The fix computes the allocation size using 64-bit arithmetic so the full bitmap is properly allocated, and it splits each hash into a word pointer plus an in-word bit number before invoking bit operations, ensuring the bit argument is always a small non-negative value. The vulnerability is reachable locally from any process holding CAP_BPF, which on most distributions requires at least a low-privileged account; it affects only 32-bit x86 kernels.

03

BranchIntroducedFixed inPatch commit
6.125.166.12.1093b7a13eccfcf
6.15.166.1.188a6183bc683f9
6.185.166.18.50272fcb4ba6fa
7.25.167.2.4dff481e12b3f
mainline5.167.3-rc111c1e836710d
6.65.166.6.15780551bf8912c
cip/6.125.166.12.111-cip323b7a13eccfcf