CVE-2026-143207: net/mlx5e: Block E-Switch mode changes during IPsec policy creation
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5e: Block E-Switch mode changes during IPsec policy creation
Eswitch mode changes can tear down the IPsec context while policy creation is accessing it. The mode-blocking reference acquired when creating a flow table comes too late: the table lookup already accesses the IPsec context before taking that reference.
Take a temporary mode-blocking reference before checking the IPsec context and validating the policy. This gets dropped after successful setup, when the flow table holds its own reference.
The temporary reservation must allow reuse of existing IPsec tables. For example: 1. An offloaded inbound IPsec policy is added on the uplink. 2. A TC flower rule is added on a VF representor. 3. Another uplink policy is added using the same RX tables.
The third policy reuses the first policy's tables, so it must not be rejected merely because esw->usercount is nonzero. Add a checkusers argument to mlx5eswitchblockmode(). Pass false for temporary policy reservations and true when creating the first table (rxget()/txget()).
Temporary reservations take modelock and check operation ownership without requiring eswitch usercount to be zero.
mlx5exfrmaddstate() needs the same early mode reservation and is handled in the next patch.
This was found by Sashiko, during review of the last patch in the series. No reproduction attempted, as it seems quite a tricky race to successfully trigger.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch net/mlx5e: Block E-Switch mode changes during IPsec policy creation
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
Systems using the Linux kernel mlx5e driver with IPsec policy creation and E-Switch mode changes are relevant. The described examples involve offloaded inbound IPsec policies on an uplink and TC flower rules on a VF representor.
What conditions trigger the issue?
The issue requires an E-Switch mode change to occur while an IPsec policy is being created. The mode change can tear down the IPsec context while policy creation is accessing it.
What can be done before applying the resolved kernel change?
Avoid changing E-Switch mode while IPsec policies are being created. This reduces the concurrent access that causes the IPsec context to be torn down during policy setup.