CVE-2024-38557·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Reload only IB representors upon lag disable/enable On lag disable, the bond IB device along with all of its representors are destroyed, and then the slaves' representors get reloaded. In case the slave IB representor load fails, the eswitch error flow unloads all representors, including ethernet representors, where the netdevs get detached and removed from lag bond. Such flow is inaccurate as the lag driver is not responsible for loading/unloading ethernet representors. Furthermore, the flow described above begins by holding lag lock to prevent bond changes during disable flow. However, when reaching the ethernet representors detachment from lag, the lag lock is required again, triggering the following deadlock: Call trace: __switch_to+0xf4/0x148 __schedule+0x2c8/0x7d0 schedule+0x50/0xe0 schedule_preempt_disabled+0x18/0x28 __mutex_lock.isra.13+0x2b8/0x570 __mutex_lock_slowpath+0x1c/0x28 mutex_lock+0x4c/0x68 mlx5_lag_remove_netdev+0x3c/0x1a0 [mlx5_core] mlx5e_uplink_rep_disable+0x70/0xa0 [mlx5_core] mlx5e_detach_netdev+0x6c/0xb0 [mlx5_core] mlx5e_netdev_change_profile+0x44/0x138 [mlx5_core] mlx5e_netdev_attach_nic_profile+0x28/0x38 [mlx5_core] mlx5e_vport_rep_unload+0x184/0x1b8 [mlx5_core] mlx5_esw_offloads_rep_load+0xd8/0xe0 [mlx5_core] mlx5_eswitch_reload_reps+0x74/0xd0 [mlx5_core] mlx5_disable_lag+0x130/0x138 [mlx5_core] mlx5_lag_disable_change+0x6c/0x70 [mlx5_core] // hold ldev->lock mlx5_devlink_eswitch_mode_set+0xc0/0x410 [mlx5_core] devlink_nl_cmd_eswitch_set_doit+0xdc/0x180 genl_family_rcv_msg_doit.isra.17+0xe8/0x138 genl_rcv_msg+0xe4/0x220 netlink_rcv_skb+0x44/0x108 genl_rcv+0x40/0x58 netlink_unicast+0x198/0x268 netlink_sendmsg+0x1d4/0x418 sock_sendmsg+0x54/0x60 __sys_sendto+0xf4/0x120 __arm64_sys_sendto+0x30/0x40 el0_svc_common+0x8c/0x120 do_el0_svc+0x30/0xa0 el0_svc+0x20/0x30 el0_sync_handler+0x90/0xb8 el0_sync+0x160/0x180 Thus, upon lag enable/disable, load and unload only the IB representors of the slaves preventing the deadlock mentioned above. While at it, refactor the mlx5_esw_offloads_rep_load() function to have a static helper method for its internal logic, in symmetry with the representor unload design.
- Severity
- medium
- Software
- Kernel
- Fixed in
- 6.9.3
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.18% — higher than 8% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
From: 6.9
Until: 6.9.3
Fixed in: 6.9.3
How to fix this CVE
Update your Linux kernel to version 6.9.3 or later to resolve a deadlock condition in the MLX5 network driver's LAG (Link Aggregation Group) handling. This vulnerability affects systems using Mellanox ConnectX network adapters with InfiniBand representors. Apply the kernel update through your distribution's package manager and reboot the system to activate the patched kernel.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Check current kernel version: uname -r
- Verify if MLX5 driver is loaded: lsmod | grep mlx5
- Check for LAG configuration: cat /proc/net/bonding/bond* (if bonding is configured)
- Search kernel logs for deadlock messages: sudo dmesg | grep -i 'deadlock\|hung_task\|mutex_lock' | grep -i mlx5
- Confirm patch application by checking kernel release date: uname -v
FAQ
What is CVE-2024-38557?
CVE-2024-38557 is a deadlock vulnerability in the Linux kernel's MLX5 Mellanox network driver that occurs when disabling LAG (Link Aggregation) bonds. The driver incorrectly attempts to reload ethernet representors while holding a lag lock, causing it to deadlock when trying to acquire the same lock again.
Is CVE-2024-38557 being actively exploited?
No, CVE-2024-38557 is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, and no public exploits are currently available. However, the vulnerability can be triggered locally by administrators who modify LAG bond configurations.
What versions of Kernel are affected by CVE-2024-38557?
Linux kernel versions 6.9 through 6.9.2 are vulnerable. The fix is included in kernel 6.9.3 and later releases.
How do I check if my server is vulnerable to CVE-2024-38557?
Run 'uname -r' to check your kernel version. If it reports 6.9.0, 6.9.1, or 6.9.2, and you have MLX5 network adapters (check with 'lsmod | grep mlx5'), your system is vulnerable.
Does Defensia detect CVE-2024-38557?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server running version 6.9.0 through 6.9.2, CVE-2024-38557 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0f06228d4a2dcc1fca5b3ddb0eefa09c05b102c4
- https://git.kernel.org/stable/c/0f320f28f54b1b269a755be2e3fb3695e0b80b07
- https://git.kernel.org/stable/c/e93fc8d959e56092e2eca1e5511c2d2f0ad6807a
- https://git.kernel.org/stable/c/f03c714a0fdd1f93101a929d0e727c28a66383fc
- https://git.kernel.org/stable/c/0f06228d4a2dcc1fca5b3ddb0eefa09c05b102c4
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-38557. Free for 1 server.
Get started free