CVE-2021-47506·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: nfsd: fix use-after-free due to delegation race A delegation break could arrive as soon as we've called vfs_setlease. A delegation break runs a callback which immediately (in nfsd4_cb_recall_prepare) adds the delegation to del_recall_lru. If we then exit nfs4_set_delegation without hashing the delegation, it will be freed as soon as the callback is done with it, without ever being removed from del_recall_lru. Symptoms show up later as use-after-free or list corruption warnings, usually in the laundromat thread. I suspect aba2072f4523 "nfsd: grant read delegations to clients holding writes" made this bug easier to hit, but I looked as far back as v3.0 and it looks to me it already had the same problem. So I'm not sure where the bug was introduced; it may have been there from the beginning.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.15.8
- Published
- 2024-05-24
Affected versions
From: 5.11
Until: 5.15.8
Fixed in: 5.15.8
How to fix this CVE
Update your Linux kernel to version 5.15.8 or later to resolve a use-after-free vulnerability in the NFS delegation handling code. This bug occurs when a delegation break races with the delegation setup process, causing memory corruption in the kernel's NFS server subsystem. Kernel versions between 5.11 and 5.15.7 are vulnerable and should be patched immediately.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your current kernel version: uname -r — if it returns 5.11.x through 5.15.7, your system is vulnerable
- Verify NFS server is running: systemctl status nfs-server — this CVE only affects systems with nfsd enabled
- Search kernel logs for delegation-related crashes: grep -i 'use-after-free\|list_corruption\|nfs4_set_delegation' /var/log/kern.log or journalctl -b | grep -i 'use-after-free'
- After patching, reboot and confirm: uname -r should show 5.15.8 or later, and dmesg should not contain delegation-related warnings
FAQ
What is CVE-2021-47506?
This vulnerability is a use-after-free condition in the Linux kernel's NFS server delegation code where a delegation break callback can free memory while it remains referenced on an internal list, leading to heap corruption and system instability.
Is CVE-2021-47506 being actively exploited?
No, this vulnerability is not listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are available. However, it causes memory corruption that manifests as kernel crashes and data corruption on affected systems.
What versions of Kernel are affected by CVE-2021-47506?
Linux kernel versions 5.11 through 5.15.7 are affected. The vulnerability was fixed in kernel 5.15.8 and later stable releases.
How do I check if my server is vulnerable to CVE-2021-47506?
Run `uname -r` and check if the output is between 5.11 and 5.15.7; additionally verify NFS server is active with `systemctl is-active nfs-server`
Does Defensia detect CVE-2021-47506?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2021-47506 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/04a8d07f3d58308b92630045560799a3faa3ebce
- https://git.kernel.org/stable/c/148c816f10fd11df27ca6a9b3238cdd42fa72cd3
- https://git.kernel.org/stable/c/2becaa990b93cbd2928292c0b669d3abb6cf06d4
- https://git.kernel.org/stable/c/33645d3e22720cac1e4548f8fef57bf0649536ee
- https://git.kernel.org/stable/c/348714018139c39533c55661a0c7c990671396b4
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47506. Free for 1 server.
Get started free