CVE-2024-50121
📋 TL;DR
A race condition vulnerability in the Linux kernel's NFS server (nfsd) can cause use-after-free errors and kernel warnings when shutting down NFS services. This occurs when the nfsd_client_shrinker work runs concurrently with nfsd shutdown operations, leading to improper resource cleanup. Systems running affected Linux kernel versions with NFS server enabled are vulnerable.
💻 Affected Systems
- Linux kernel
📦 What is this software?
Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →⚠️ Risk & Real-World Impact
Worst Case
Kernel panic or system crash leading to denial of service, potentially allowing privilege escalation if memory corruption leads to code execution.
Likely Case
System instability, kernel warnings in logs, and denial of service when NFS services are stopped or restarted.
If Mitigated
Minor performance impact during NFS shutdown operations with proper synchronization.
🎯 Exploit Status
Exploitation requires ability to trigger NFS server shutdown operations, typically requiring local or administrative access. Race condition timing makes reliable exploitation challenging.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in Linux kernel stable releases via commits: 36775f42e039b01d4abe8998bf66771a37d3cdcc, 5ade4382de16c34d9259cb548f36ec5c4555913c, add1df5eba163a3a6ece11cb85890e2e410baaea, d5ff2fb2e7167e9483846e34148e60c0c016a1f6, f67138dd338cb564ade7d3755c8cd4f68b46d397
Vendor Advisory: https://git.kernel.org/stable/c/36775f42e039b01d4abe8998bf66771a37d3cdcc
Restart Required: Yes
Instructions:
1. Update Linux kernel to patched version from your distribution vendor. 2. Reboot system to load new kernel. 3. Verify NFS services restart properly.
🔧 Temporary Workarounds
Disable NFS server
linuxIf NFS server functionality is not required, disable it to eliminate vulnerability.
systemctl stop nfs-server
systemctl disable nfs-server
Avoid manual NFS shutdown
linuxAvoid writing '0' to /proc/fs/nfsd/threads which triggers the vulnerable code path.
🧯 If You Can't Patch
- Monitor system logs for kernel warnings related to nfsd_file or nfsd_file_mark objects
- Implement strict access controls to prevent unauthorized users from manipulating NFS server state
🔍 How to Verify
Check if Vulnerable:
Check kernel version and if NFS server is running: 'uname -r' and 'systemctl status nfs-server' or 'ps aux | grep nfsd'
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version includes fix commits and test NFS shutdown: 'echo 0 > /proc/fs/nfsd/threads' followed by restart, monitor logs for absence of warnings.
📡 Detection & Monitoring
Log Indicators:
- Kernel warnings with 'BUG nfsd_file' or 'BUG nfsd_file_mark' in dmesg or system logs
- Use-after-free errors in kernel logs during NFS operations
Network Indicators:
- Unexpected NFS service restarts or failures
SIEM Query:
source="kernel" AND ("nfsd_file" OR "nfsd_file_mark") AND ("BUG" OR "warning" OR "use-after-free")
🔗 References
- https://git.kernel.org/stable/c/36775f42e039b01d4abe8998bf66771a37d3cdcc
- https://git.kernel.org/stable/c/5ade4382de16c34d9259cb548f36ec5c4555913c
- https://git.kernel.org/stable/c/add1df5eba163a3a6ece11cb85890e2e410baaea
- https://git.kernel.org/stable/c/d5ff2fb2e7167e9483846e34148e60c0c016a1f6
- https://git.kernel.org/stable/c/f67138dd338cb564ade7d3755c8cd4f68b46d397
- https://git.kernel.org/stable/c/f965dc0f099a54fca100acf6909abe52d0c85328
- https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html
- https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html