CVE-2026-45907: net/mlx5e: Fix deadlocks between devlink and netdev instance locks
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5e: Fix deadlocks between devlink and netdev instance locks
In the mentioned "Fixes" commit, various work tasks triggering devlink health reporter recovery were switched to use netdev_trylock to protect against concurrent tear down of the channels being recovered. But this had the side effect of introducing potential deadlocks because of incorrect lock ordering.
The correct lock order is described by the init flow:probe_one -> mlx5_init_one (acquires devlink lock)
-> mlx5_init_one_devl_locked -> mlx5_register_device -> mlx5_rescan_drivers_locked -...-> mlx5e_probe -> _mlx5e_probe -> register_netdev (acquires rtnl lock)
-> register_netdevice (acquires netdev lock)
=> devlink lock -> rtnl lock -> netdev lock.
But in the current recovery flow, the order is wrong:mlx5e_tx_err_cqe_work (acquires netdev lock)
-> mlx5e_reporter_tx_err_cqe -> mlx5e_health_report
-> devlink_health_report (acquires devlink lock => boom!) -> devlink_health_reporter_recover
-> mlx5e_tx_reporter_recover -> mlx5e_tx_reporter_recover_from_ctx -> mlx5e_tx_reporter_err_cqe_recover
The same pattern exists in:mlx5e_reporter_rx_timeoutmlx5e_reporter_tx_ptpsq_unhealthymlx5e_reporter_tx_timeout
Fix these by moving the netdev_trylock calls from the work handlers lower in the call stack, in the respective recovery functions, where they are actually necessary.
The Linux kernel CVE team has assigned CVE-2026-45907 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.16 with commit 8f7b00307bf14676b7e7f0210110a36aa0ff3e93 and fixed in 6.18.14 with commit 4329514c61abefe4961541b128c549b017bab5ad Issue introduced in 6.16 with commit 8f7b00307bf14676b7e7f0210110a36aa0ff3e93 and fixed in 6.19.4 with commit 63f9d5fb4d8040077df801ca3270e2f02d55e0d9 Issue introduced in 6.16 with commit 8f7b00307bf14676b7e7f0210110a36aa0ff3e93 and fixed in 7.0 with commit 83ac0304a2d77519dae1e54c9713cbe1aedf19c9
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-45907
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/4329514c61abefe4961541b128c549b017bab5ad https://git.kernel.org/stable/c/63f9d5fb4d8040077df801ca3270e2f02d55e0d9 https://git.kernel.org/stable/c/83ac0304a2d77519dae1e54c9713cbe1aedf19c9