CVE-2024-40940·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Fix tainted pointer delete is case of flow rules creation fail In case of flow rule creation fail in mlx5_lag_create_port_sel_table(), instead of previously created rules, the tainted pointer is deleted deveral times. Fix this bug by using correct flow rules pointers. Found by Linux Verification Center (linuxtesting.org) with SVACE.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.6
- Published
- 2024-07-12
Affected versions
From: 6.7
Until: 6.9.6
Fixed in: 6.9.6
How to fix this CVE
Update your Linux kernel to version 6.9.6 or later to resolve a memory safety issue in the MLX5 network driver where failed flow rule creation could cause repeated deletion of invalid pointers. This patch ensures proper pointer tracking during error handling in the lag port selection table initialization. Apply the update immediately as this affects systems using Mellanox network adapters.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your kernel version: uname -r — if the version is between 6.7 and 6.9.5, you are vulnerable
- Verify MLX5 driver presence: lspci | grep -i mellanox or ethtool -i eth0 | grep mlx5 to confirm the affected network adapter is in use
- Search kernel logs for memory errors: sudo dmesg | grep -i 'use-after-free\|invalid pointer\|null pointer' to detect past exploitation attempts
- Confirm patch application: grep -i '6.9.6' /boot/config-$(uname -r) or compare current kernel version after update with uname -r
FAQ
What is CVE-2024-40940?
CVE-2024-40940 is a kernel memory safety vulnerability in the MLX5 network driver where improper pointer management during flow rule creation failure can lead to use-after-free conditions, potentially causing system instability or privilege escalation on systems with Mellanox adapters.
Is CVE-2024-40940 being actively exploited?
No, CVE-2024-40940 is not currently listed in the CISA Known Exploited Vulnerabilities catalog and no public exploits are available. However, the vulnerability still requires patching due to its high CVSS score of 7.8.
What versions of Kernel are affected by CVE-2024-40940?
Linux kernel versions 6.7 through 6.9.5 are affected. The vulnerability is fixed in kernel 6.9.6 and later releases.
How do I check if my server is vulnerable to CVE-2024-40940?
Run 'uname -r' to display your kernel version. If it shows a version between 6.7 and 6.9.5 and you have Mellanox network adapters (confirmed via 'lspci | grep -i mellanox'), your system is vulnerable.
Does Defensia detect CVE-2024-40940?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2024-40940 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/229bedbf62b13af5aba6525ad10b62ad38d9ccb5
- https://git.kernel.org/stable/c/531eab2da27dd42d68dfb841d82e987f4a6738b8
- https://git.kernel.org/stable/c/a03a3fa12769e25f4385bee587afe1445aee7f7a
- https://git.kernel.org/stable/c/d857df86837ac1c30592e8a068204d16feac9930
- https://git.kernel.org/stable/c/229bedbf62b13af5aba6525ad10b62ad38d9ccb5
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-40940. Free for 1 server.
Get started free