CVE-2021-47107·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: NFSD: Fix READDIR buffer overflow If a client sends a READDIR count argument that is too small (say, zero), then the buffer size calculation in the new init_dirlist helper functions results in an underflow, allowing the XDR stream functions to write beyond the actual buffer. This calculation has always been suspect. NFSD has never sanity- checked the READDIR count argument, but the old entry encoders managed the problem correctly. With the commits below, entry encoding changed, exposing the underflow to the pointer arithmetic in xdr_reserve_space(). Modern NFS clients attempt to retrieve as much data as possible for each READDIR request. Also, we have no unit tests that exercise the behavior of READDIR at the lower bound of @count values. Thus this case was missed during testing.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.15.12
- Published
- 2024-03-04
Affected versions
From: 5.13
Until: 5.15.12
Fixed in: 5.15.12
How to fix this CVE
Update your Linux kernel to version 5.15.12 or later to patch a buffer overflow vulnerability in the NFSD READDIR implementation. This vulnerability occurs when clients send unusually small READDIR count values, causing memory corruption in the XDR stream encoding. Apply the patch immediately if you are running kernel versions 5.13 through 5.15.11 and expose NFS services.
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 NFSD is active: systemctl status nfs-server or ps aux | grep nfsd
- Check kernel logs for memory corruption or XDR-related warnings: dmesg | grep -i 'xdr\|nfsd\|buffer\|overflow'
- After patching, reboot and confirm the new kernel: uname -r (should show 5.15.12 or higher)
- Verify NFSD functionality post-patch: showmount -e localhost
FAQ
What is CVE-2021-47107?
CVE-2021-47107 is a buffer overflow vulnerability in the Linux kernel's NFSD (Network File System Daemon) READDIR handler that occurs when clients send abnormally small count values, causing the XDR encoder to write beyond allocated buffer boundaries.
Is CVE-2021-47107 being actively exploited?
No, this vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and there are no public exploits available. However, it remains a high-severity issue due to its potential for local privilege escalation or denial of service.
What versions of Kernel are affected by CVE-2021-47107?
Linux kernel versions 5.13 through 5.15.11 are vulnerable. The vulnerability was resolved in version 5.15.12 and later.
How do I check if my server is vulnerable to CVE-2021-47107?
Run 'uname -r' to check your kernel version. If it shows any version between 5.13 and 5.15.11 and NFSD is enabled (check with 'systemctl status nfs-server'), your system is vulnerable.
Does Defensia detect CVE-2021-47107?
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-47107 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/53b1119a6e5028b125f431a0116ba73510d82a72
- https://git.kernel.org/stable/c/9e291a6a28d32545ed2fd959a8165144d1724df1
- https://git.kernel.org/stable/c/eabc0aab98e5218ceecd82069b0d6fdfff5ee885
- https://git.kernel.org/stable/c/53b1119a6e5028b125f431a0116ba73510d82a72
- https://git.kernel.org/stable/c/9e291a6a28d32545ed2fd959a8165144d1724df1
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47107. Free for 1 server.
Get started free