Linux Kernel BPF Reuseport Memory Leak Vulnerability

Vulnerability

A memory leak vulnerability has been identified in the Linux kernel's BPF (Berkeley Packet Filter) implementation, specifically within the reuseport functionality. The issue arises when a TCP socket, which may have had the SO_ATTACH_REUSEPORT_EBPF option set, is returned by the sockmap lookup as ESTABLISHED. This scenario can lead to a non-refcounted socket being improperly managed, causing a memory leak. The vulnerability allows for an unreferenced object to persist, as indicated by the kernel's memory management and backtrace logs.

Impact

Exploitation of this vulnerability leads to a memory leak, where allocated memory is not properly released, potentially causing increased memory usage and degradation of system performance over time.

Reproduction

The vulnerability can be reproduced by attaching a BPF program to a TCP socket using the SO_ATTACH_REUSEPORT_EBPF option, and then allowing the socket to transition to the ESTABLISHED state. Once the socket is established, the BPF program's attachment can result in a memory leak, as the socket's reference is not properly managed.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
2.5
exploitability
5.7
remediation
0.0
relevance
0.0
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.