CVE-2021-47396·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: mac80211-hwsim: fix late beacon hrtimer handling Thomas explained in https://lore.kernel.org/r/87mtoeb4hb.ffs@tglx that our handling of the hrtimer here is wrong: If the timer fires late (e.g. due to vCPU scheduling, as reported by Dmitry/syzbot) then it tries to actually rearm the timer at the next deadline, which might be in the past already: 1 2 3 N N+1 | | | ... | | ^ intended to fire here (1) ^ next deadline here (2) ^ actually fired here The next time it fires, it's later, but will still try to schedule for the next deadline (now 3), etc. until it catches up with N, but that might take a long time, causing stalls etc. Now, all of this is simulation, so we just have to fix it, but note that the behaviour is wrong even per spec, since there's no value then in sending all those beacons unaligned - they should be aligned to the TBTT (1, 2, 3, ... in the picture), and if we're a bit (or a lot) late, then just resume at that point. Therefore, change the code to use hrtimer_forward_now() which will ensure that the next firing of the timer would be at N+1 (in the picture), i.e. the next interval point after the current time.
- Severity
- medium
- Software
- Kernel
- Fixed in
- 5.14.10
- Published
- 2024-05-21
Affected versions
From: 5.11
Until: 5.14.10
Fixed in: 5.14.10
How to fix this CVE
Update your Linux kernel to version 5.14.10 or later to resolve this beacon timer scheduling issue in mac80211-hwsim. The vulnerability causes improper hrtimer handling that can lead to system stalls when virtual CPU scheduling delays occur. Apply the kernel update and reboot your system to ensure the fix takes effect.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check current kernel version with `uname -r` and compare against 5.14.10+
- Step 2: Verify mac80211-hwsim module is loaded with `lsmod | grep mac80211_hwsim`
- Step 3: Search system logs for beacon timing anomalies with `grep -i 'beacon\|hrtimer' /var/log/kern.log | tail -100`
- Step 4: Confirm patch applied by checking commit hash in `/proc/version` or verifying kernel version is ≥5.14.10 with `uname -r`
FAQ
What is CVE-2021-47396?
This vulnerability affects the mac80211-hwsim wireless simulation module in the Linux kernel, causing improper beacon timer (hrtimer) scheduling when firing late. When timer delays accumulate due to vCPU scheduling issues, beacons become misaligned and can cause system stalls.
Is CVE-2021-47396 being actively exploited?
No, this vulnerability is not being actively exploited in the wild or tracked in the CISA KEV catalog. It primarily affects kernel simulation environments and wireless testing scenarios.
What versions of Kernel are affected by CVE-2021-47396?
Kernel versions 5.11 through 5.14.9 are vulnerable. Versions 5.14.10 and later contain the fix.
How do I check if my server is vulnerable to CVE-2021-47396?
Run `uname -r` to check your kernel version. If it shows 5.11.x through 5.14.9, you are vulnerable. Additionally, run `lsmod | grep mac80211_hwsim` to confirm if the affected module is loaded.
Does Defensia detect CVE-2021-47396?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Linux kernel is installed on a monitored server, CVE-2021-47396 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/2c204cf594df3b9468368dc9d0b24d482d93cda7
- https://git.kernel.org/stable/c/313bbd1990b6ddfdaa7da098d0c56b098a833572
- https://git.kernel.org/stable/c/9bee85de2c8155388c09a2e1530a243ec1c96f05
- https://git.kernel.org/stable/c/ed2adf69e29848d1eb9df99633dde655421c92ed
- https://git.kernel.org/stable/c/2c204cf594df3b9468368dc9d0b24d482d93cda7
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47396. Free for 1 server.
Get started free