CVE-2024-38568
📋 TL;DR
This CVE describes an out-of-bounds write vulnerability in the HNS3 network driver in the Linux kernel's performance monitoring subsystem. Attackers with local access can trigger memory corruption by creating event groups with more than 9 events through the perf tool. This affects Linux systems using the HNS3 driver for HiSilicon network hardware.
💻 Affected Systems
- Linux kernel with HNS3 network 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 →⚠️ Risk & Real-World Impact
Worst Case
Kernel memory corruption leading to privilege escalation, denial of service, or arbitrary code execution in kernel context.
Likely Case
Kernel panic or system crash causing denial of service, potentially requiring physical access to restart.
If Mitigated
Limited to denial of service if proper access controls prevent unauthorized users from using perf tool.
🎯 Exploit Status
Requires local access and ability to run perf commands. Exploit would need to craft specific event groups to trigger overflow.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Kernel versions with commits: 3669baf308308385a2ab391324abdde5682af5aa, 81bdd60a3d1d3b05e6cc6674845afb1694dd3a0e, aa2d3d678895c8eedd003f1473f87d3f06fe6ec7, b5120d322763c15c978bc47beb3b6dff45624304, be1fa711e59c874d049f592aef1d4685bdd22bdf
Vendor Advisory: https://git.kernel.org/stable/c/
Restart Required: Yes
Instructions:
1. Update Linux kernel to version containing the fix commits. 2. Reboot system to load new kernel. 3. Verify kernel version after reboot.
🔧 Temporary Workarounds
Restrict perf tool access
linuxLimit which users can execute perf commands to prevent exploitation
chmod 750 /usr/bin/perf
setcap -r /usr/bin/perf
Use sudoers to restrict perf usage
Disable HNS3 driver if not needed
linuxRemove or blacklist the HNS3 driver if HiSilicon hardware is not used
echo 'blacklist hns3' >> /etc/modprobe.d/blacklist.conf
rmmod hns3
🧯 If You Can't Patch
- Restrict local user access and monitor for unauthorized perf usage
- Implement strict privilege separation and limit perf tool to trusted administrators only
🔍 How to Verify
Check if Vulnerable:
Check if HNS3 driver is loaded: lsmod | grep hns3. Check kernel version against patched versions.
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version includes fix commits. Test perf with event groups >9 events to ensure no crash.
📡 Detection & Monitoring
Log Indicators:
- Kernel panic logs
- OOM killer messages related to perf
- System crash/reboot events
Network Indicators:
- None - local exploit only
SIEM Query:
source="kernel" AND ("panic" OR "Oops" OR "general protection fault") AND process="perf"
🔗 References
- https://git.kernel.org/stable/c/3669baf308308385a2ab391324abdde5682af5aa
- https://git.kernel.org/stable/c/81bdd60a3d1d3b05e6cc6674845afb1694dd3a0e
- https://git.kernel.org/stable/c/aa2d3d678895c8eedd003f1473f87d3f06fe6ec7
- https://git.kernel.org/stable/c/b5120d322763c15c978bc47beb3b6dff45624304
- https://git.kernel.org/stable/c/be1fa711e59c874d049f592aef1d4685bdd22bdf
- https://git.kernel.org/stable/c/3669baf308308385a2ab391324abdde5682af5aa
- https://git.kernel.org/stable/c/81bdd60a3d1d3b05e6cc6674845afb1694dd3a0e
- https://git.kernel.org/stable/c/aa2d3d678895c8eedd003f1473f87d3f06fe6ec7
- https://git.kernel.org/stable/c/b5120d322763c15c978bc47beb3b6dff45624304
- https://git.kernel.org/stable/c/be1fa711e59c874d049f592aef1d4685bdd22bdf