CVE-2025-40238
kernel: net/mlx5: Fix IPsec cleanup over MPV device
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · December 4, 2025
Updated · June 30, 2026
Description
Mellanox ConnectX drivers encounter a race during network device detachment where IPsec MPV events continue arriving after the netdev becomes invalid. The mlx5e_detach_netdev() path disables event handlers too late, allowing mlx5_devcom_comp_set_ready() to dereference a stale pointer. Proper ordering requires devcom unregistration before blocking event handlers are disabled.
Statement
This race condition affects systems running Mellanox ConnectX NICs with eswitch mode changes while IPsec is configured. The window for exploitation is narrow, requiring precise timing during administrative operations.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 4.7CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-367 · Time-of-check Time-of-use (TOCTOU) Race Condition