CVE-2024-36021
📋 TL;DR
A race condition vulnerability in the Linux kernel's HNS3 network driver allows kernel crashes when devlink reload commands are issued during PF (Physical Function) initialization. This affects systems using Huawei HNS3 network hardware with vulnerable kernel versions. The crash occurs due to hardware resource access before proper initialization.
💻 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 panic leading to system crash and denial of service, requiring physical or remote console access for recovery.
Likely Case
System crash during network interface initialization or maintenance operations, causing temporary service disruption.
If Mitigated
No impact if patched or if devlink reload operations are avoided during initialization.
🎯 Exploit Status
Exploitation requires timing devlink reload commands precisely during initialization phase. More likely to occur accidentally during maintenance than maliciously.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Kernel versions containing commits: 1b550dae55901c2cc9075d6a7155a71b4f516e86, 50b69054f455dcdb34bd6b22764c7579b270eef3, 7ca0f73e5e2da3c129935b97f3a0877cce8ebdf5, 93305b77ffcb042f1538ecc383505e87d95aa05a
Vendor Advisory: https://git.kernel.org/stable/c/1b550dae55901c2cc9075d6a7155a71b4f516e86
Restart Required: Yes
Instructions:
1. Update Linux kernel to patched version. 2. Reboot system. 3. Verify kernel version and that HNS3 driver loads without issues.
🔧 Temporary Workarounds
Avoid devlink reload during initialization
linuxPrevent devlink reload operations during system boot or HNS3 PF initialization phases
# Ensure no automation scripts run 'devlink dev reload' during boot
# Monitor system logs for HNS3 initialization completion before running any devlink commands
🧯 If You Can't Patch
- Avoid using devlink reload commands on systems with HNS3 hardware
- Implement monitoring to detect and alert on kernel panic events related to HNS3 driver
🔍 How to Verify
Check if Vulnerable:
Check kernel version and if HNS3 driver is loaded: 'uname -r' and 'lsmod | grep hns3'
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version includes the fix commits and test devlink reload after HNS3 initialization completes
📡 Detection & Monitoring
Log Indicators:
- Kernel panic messages
- HNS3 driver initialization failures
- System crash/reboot events
Network Indicators:
- Network interface disappearance
- Loss of connectivity on HNS3 interfaces
SIEM Query:
event_source="kernel" AND (message CONTAINS "panic" OR message CONTAINS "hns3" OR message CONTAINS "Oops")
🔗 References
- https://git.kernel.org/stable/c/1b550dae55901c2cc9075d6a7155a71b4f516e86
- https://git.kernel.org/stable/c/50b69054f455dcdb34bd6b22764c7579b270eef3
- https://git.kernel.org/stable/c/7ca0f73e5e2da3c129935b97f3a0877cce8ebdf5
- https://git.kernel.org/stable/c/93305b77ffcb042f1538ecc383505e87d95aa05a
- https://git.kernel.org/stable/c/1b550dae55901c2cc9075d6a7155a71b4f516e86
- https://git.kernel.org/stable/c/50b69054f455dcdb34bd6b22764c7579b270eef3
- https://git.kernel.org/stable/c/7ca0f73e5e2da3c129935b97f3a0877cce8ebdf5
- https://git.kernel.org/stable/c/93305b77ffcb042f1538ecc383505e87d95aa05a