CVE-2021-47394·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_tables: unlink table before deleting it syzbot reports following UAF: BUG: KASAN: use-after-free in memcmp+0x18f/0x1c0 lib/string.c:955 nla_strcmp+0xf2/0x130 lib/nlattr.c:836 nft_table_lookup.part.0+0x1a2/0x460 net/netfilter/nf_tables_api.c:570 nft_table_lookup net/netfilter/nf_tables_api.c:4064 [inline] nf_tables_getset+0x1b3/0x860 net/netfilter/nf_tables_api.c:4064 nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 Problem is that all get operations are lockless, so the commit_mutex held by nft_rcv_nl_event() isn't enough to stop a parallel GET request from doing read-accesses to the table object even after synchronize_rcu(). To avoid this, unlink the table first and store the table objects in on-stack scratch space.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.14.10
- Published
- 2024-05-21
Affected versions
From: 5.12
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 use-after-free vulnerability in the netfilter nf_tables subsystem. The vulnerability allows local authenticated attackers to trigger a memory access violation through concurrent table lookup operations. Ensure you reboot the system after applying the kernel update to activate the patched version.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your current kernel version: uname -r
- Verify if netfilter nf_tables is loaded: lsmod | grep nf_tables
- Review kernel logs for UAF (use-after-free) KASAN errors: sudo dmesg | grep -i 'kasan\|use-after-free'
- Confirm the patched version is installed after update: uname -r | grep -E '5\.14\.(1[0-9]|[2-9])|5\.(1[5-9]|[2-9][0-9])'
- Verify nftables rules are still functional: sudo nft list tables
FAQ
What is CVE-2021-47394?
This is a use-after-free vulnerability in the Linux kernel's netfilter nf_tables subsystem that occurs when table deletion and concurrent GET operations race without proper synchronization, allowing local users to read freed memory.
Is CVE-2021-47394 being actively exploited?
No, according to CISA KEV data, CVE-2021-47394 is not listed as actively exploited in the wild. However, it remains a high-severity local privilege escalation vector that should be patched promptly.
What versions of Kernel are affected by CVE-2021-47394?
Linux kernel versions 5.12 through 5.14.9 are vulnerable. Versions 5.14.10 and later include the fix.
How do I check if my server is vulnerable to CVE-2021-47394?
Run 'uname -r' and check if the version is between 5.12 and 5.14.9. If yes, your system is vulnerable. Additionally, confirm nf_tables is in use with 'sudo nft list tables'.
Does Defensia detect CVE-2021-47394?
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-47394 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-47394. Free for 1 server.
Get started free