CRITICAL Introduced in 6.4
mlx5e XSK UAF
CVE-2026-99078
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: net/mlx5e: Prevent stale XSK buffer release on MPWQE refill retry With AF_XDP on a striding RQ, mlx5e defers releasing XSK buffers until an MPWQE is refilled. If XSK allocation then returns -ENOMEM, actual_wq_head is not advanced and a later NAPI poll retries the same WQE. mlx5e_free_rx_mpwqe() leaves each released slot marked as releasable. On retry it can therefore call xsk_buff_free() again through stale pointers after the frames have returned to the XSK pool and been reallocated. Set all skip_release_bitmap bits in the common error path of mlx5e_xsk_alloc_rx_mpwqe(). This matches mlx5e_alloc_rx_mpwqe(). A successful allocation already clears the bitmap after replacing every buffer, so retries become idempotent without changing the success path. Fault injection forced three consecutive failures for one selected MPWQE. Both an early allocation failure and a partial 8-of-16-buffer unwind released the original 16 XSK buffers only once. Each error left a full bitmap, the following NAPI retry skipped the release, and a later successful allocation cleared it. A 20-second AF_XDP zero-copy pressure run exercised 1,575,262 buffer allocation failures without invalid descriptors, WQE errors, or kernel warnings.
02KernelScan AI Analysis
Risk summary
A local attacker with AF_XDP socket access on a Mellanox mlx5e NIC can trigger a use-after-free by exhausting memory during MPWQE refill, causing the driver to free the same XSK buffers twice on retry. This leads to kernel memory corruption, enabling privilege escalation or denial of service.
Vulnerability analysis
When AF_XDP operates on a striding receive queue, the mlx5e driver defers releasing XSK buffers until a multi-packet WQE (MPWQE) is refilled. If buffer allocation fails with ENOMEM, the WQE is not advanced and a later NAPI poll retries the same WQE. However, the original error path did not mark the slots as 'skip release', so the retry path would call xsk_buff_free() again on buffers that had already been returned to the XSK pool and potentially reallocated for other purposes. The fix sets all bits in the skip_release_bitmap on any allocation error, making retries idempotent. An attacker with local access who can create AF_XDP sockets (requiring CAP_NET_ADMIN, obtainable in a user namespace) and induce memory pressure can trigger this condition on Mellanox ConnectX-4/5/6/7 hardware.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.4 | 6.12.113 | d215d09606b0 |
| 6.18 | 6.4 | 6.18.57 | 867119b4b588 |
| 6.6 | 6.4 | 6.6.160 | f3a52e2ec278 |
| 7.2 | 6.4 | 7.2.11 | 3d73a1164a8c |
| mainline | 6.4 | 7.3 | 63811edf5125 |
| cip/6.12 | 6.4 | 6.12.114-cip34 | d215d09606b0 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |