CVE-2024-38545
📋 TL;DR
This CVE describes a use-after-free vulnerability in the Linux kernel's RDMA/hns driver where concurrent CQ asynchronous events and CQ destruction can cause the kernel to access freed memory. This affects systems using the hns RDMA driver, primarily servers with Huawei network adapters. The vulnerability could lead to kernel crashes or potential privilege escalation.
💻 Affected Systems
- Linux kernel with hns RDMA driver
📦 What is this software?
Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →⚠️ Risk & Real-World Impact
Worst Case
Kernel panic leading to system crash, or potential privilege escalation to kernel-level access allowing full system compromise.
Likely Case
System instability, kernel crashes, or denial of service affecting RDMA functionality.
If Mitigated
Limited impact with proper access controls; attackers would need local access and RDMA permissions.
🎯 Exploit Status
Exploitation requires local access and knowledge of RDMA operations. Race condition makes reliable exploitation challenging.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Linux kernel with commits 330c825e66ef65278e4ebe57fd49c1d6f3f4e34e or later
Vendor Advisory: https://git.kernel.org/stable/c/330c825e66ef65278e4ebe57fd49c1d6f3f4e34e
Restart Required: Yes
Instructions:
1. Update Linux kernel to version containing the fix commits. 2. For distributions: Use package manager (apt/yum/dnf) to update kernel. 3. Reboot system to load new kernel.
🔧 Temporary Workarounds
Disable hns RDMA driver
linuxPrevent loading of the vulnerable driver module
echo 'blacklist hns' >> /etc/modprobe.d/blacklist-hns.conf
rmmod hns
Restrict RDMA access
linuxLimit which users can access RDMA devices
chmod 600 /dev/infiniband/*
setfacl -m u:root:rw /dev/infiniband/*
🧯 If You Can't Patch
- Implement strict access controls to limit local user access to the system
- Monitor system logs for kernel panic or crash events related to RDMA operations
🔍 How to Verify
Check if Vulnerable:
Check if hns module is loaded: lsmod | grep hns. Check kernel version: uname -r and compare with patched versions.
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version after update contains fix commits. Check /proc/version or use distribution-specific package verification.
📡 Detection & Monitoring
Log Indicators:
- Kernel panic messages in /var/log/kern.log or dmesg
- RDMA-related crash reports
- Use-after-free kernel warnings
Network Indicators:
- Unusual RDMA traffic patterns if exploited
SIEM Query:
source="kernel" AND ("panic" OR "Oops" OR "use-after-free") AND "hns"
🔗 References
- https://git.kernel.org/stable/c/330c825e66ef65278e4ebe57fd49c1d6f3f4e34e
- https://git.kernel.org/stable/c/37a7559dc1358a8d300437e99ed8ecdab0671507
- https://git.kernel.org/stable/c/39d26cf46306bdc7ae809ecfdbfeff5aa1098911
- https://git.kernel.org/stable/c/63da190eeb5c9d849b71f457b15b308c94cbaf08
- https://git.kernel.org/stable/c/763780ef0336a973e933e40e919339381732dcaf
- https://git.kernel.org/stable/c/a942ec2745ca864cd8512142100e4027dc306a42
- https://git.kernel.org/stable/c/37a7559dc1358a8d300437e99ed8ecdab0671507
- https://git.kernel.org/stable/c/39d26cf46306bdc7ae809ecfdbfeff5aa1098911
- https://git.kernel.org/stable/c/63da190eeb5c9d849b71f457b15b308c94cbaf08
- https://git.kernel.org/stable/c/763780ef0336a973e933e40e919339381732dcaf
- https://git.kernel.org/stable/c/a942ec2745ca864cd8512142100e4027dc306a42