Linux Kernel net/mlx5e: Reference Counting Vulnerability in XDP Multi-Buf Programs

Vulnerability

A vulnerability has been identified in the Linux kernel's mlx5 driver, specifically in the handling of XDP (eXpress Data Path) multi-buffer programs. This issue arises because these programs can alter the layout of the XDP buffer, particularly when they invoke the functions 'bpf_xdp_pull_data()' or 'bpf_xdp_adjust_tail()'. The mlx5 driver initially operated under the incorrect assumption that the XDP buffer layout would remain constant throughout program execution. While a recent fix addressed this misconception, it inadvertently created a new problem: the driver failed to properly account for dropped fragments, leading to errors in page fragment reference counting.

Impact

The vulnerability causes negative reference counting errors, which can disrupt the proper management of memory fragments, potentially leading to memory corruption or other undefined behaviors.

Reproduction

The vulnerability can be reproduced using the 'drivers/net/xdp.py' self-test, specifically the 'test_xdp_native_tx_mb' test. This test simulates a scenario where the mlx5 driver receives a packet with no payload. The XDP program processes the packet, pulls the header into the linear part of the buffer, and drops the tail fragment, which no longer contains data. As a result, the driver releases all fragments of the associated page, but the reference count is left one fragment short, creating a negative reference counting error.

Remediation

The vulnerability has been addressed in the Linux kernel. Users can upgrade to the latest version of the stable Linux kernel to apply the fix.

Added: May 8, 2026, 7:13 PM
Updated: May 8, 2026, 7:13 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
0.6
exploitability
5.3
remediation
7.7
relevance
7.8
threat
4.8
urgency
2.9
incentive
0.0

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