CVE-2021-47318·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: arch_topology: Avoid use-after-free for scale_freq_data Currently topology_scale_freq_tick() (which gets called from scheduler_tick()) may end up using a pointer to "struct scale_freq_data", which was previously cleared by topology_clear_scale_freq_source(), as there is no protection in place here. The users of topology_clear_scale_freq_source() though needs a guarantee that the previously cleared scale_freq_data isn't used anymore, so they can free the related resources. Since topology_scale_freq_tick() is called from scheduler tick, we don't want to add locking in there. Use the RCU update mechanism instead (which is already used by the scheduler's utilization update path) to guarantee race free updates here. synchronize_rcu() makes sure that all RCU critical sections that started before it is called, will finish before it returns. And so the callers of topology_clear_scale_freq_source() don't need to worry about their callback getting called anymore.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.13.4
- Published
- 2024-05-21
Affected versions
From: 5.13
Until: 5.13.4
Fixed in: 5.13.4
How to fix this CVE
Update your Linux kernel to version 5.13.4 or later to resolve this use-after-free vulnerability in the architecture topology scaling frequency subsystem. The vulnerability allows a race condition between scheduler tick operations and frequency data cleanup routines; applying the patch ensures proper RCU synchronization prevents stale pointer access.
sudo dnf check-update kernel && sudo dnf update kernelDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed kernel version with `uname -r` and confirm if it falls within 5.13.0 to 5.13.3
- Step 2: Verify the scale_freq_data component is enabled by checking `/sys/devices/system/cpu/` for frequency scaling entries
- Step 3: Search kernel logs with `sudo dmesg | grep -i 'use.after.free\|scale_freq\|topology' or journalctl -k | grep -i 'segfault\|page.fault' for potential crash signatures
- Step 4: After patching, run `uname -r` to confirm kernel version is 5.13.4 or later, then reboot and verify with `dmesg | head -20` for clean boot messages
FAQ
What is CVE-2021-47318?
CVE-2021-47318 is a use-after-free vulnerability in the Linux kernel's architecture topology subsystem where the frequency scaling tick handler may access freed memory if topology_clear_scale_freq_source() is called concurrently, leading to potential system crashes or privilege escalation.
Is CVE-2021-47318 being actively exploited?
No, CVE-2021-47318 is not listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are currently available.
What versions of Kernel are affected by CVE-2021-47318?
Linux kernel versions 5.13.0 through 5.13.3 are vulnerable; the issue was resolved in 5.13.4.
How do I check if my server is vulnerable to CVE-2021-47318?
Run `uname -r` and check if the output is 5.13.0, 5.13.1, 5.13.2, or 5.13.3; if so, your system requires patching.
Does Defensia detect CVE-2021-47318?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2021-47318 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47318. Free for 1 server.
Get started free