CVE-2022-50401
📋 TL;DR
This CVE describes a double-free vulnerability in the Linux kernel's NFS server (nfsd) under NFSv4.1. When rpc_create fails during callback connection setup, the error handling path incorrectly calls svc_xprt_put twice on the same transport object, causing a use-after-free condition that can crash the kernel or potentially lead to privilege escalation. Systems running Linux kernels with NFS server enabled are affected.
💻 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 →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 leading to system crash, or potential privilege escalation to kernel mode allowing full system compromise.
Likely Case
Kernel crash or system instability when NFSv4.1 callback connections fail, causing denial of service.
If Mitigated
No impact if NFS server is disabled or NFSv4.1 callbacks are not used.
🎯 Exploit Status
Exploitation requires triggering specific NFSv4.1 callback failure conditions. The vulnerability is in error handling code, making reliable exploitation challenging.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in kernel commits: 15fc60aa5bdcf6d5f93000d3d00579fc67632ee0, 3bc8edc98bd43540dbe648e4ef91f443d6d20a24, 707bcca9616002d204091ca7c4d1d91151104332, 9b4ae8c42d2ff09ed7c5832ccce5684c55e5ed23, a472f069ced8601979f53c13c0cf20236074ed46
Vendor Advisory: https://git.kernel.org/stable/c/15fc60aa5bdcf6d5f93000d3d00579fc67632ee0
Restart Required: Yes
Instructions:
1. Update Linux kernel to patched version from your distribution. 2. For RHEL/CentOS: 'yum update kernel'. 3. For Ubuntu/Debian: 'apt update && apt upgrade linux-image-*'. 4. Reboot system to load new kernel.
🔧 Temporary Workarounds
Disable NFS server
linuxStop and disable nfs-server service if not needed
systemctl stop nfs-server
systemctl disable nfs-server
Disable NFSv4.1 callbacks
linuxConfigure NFS server to not use NFSv4.1 callbacks
echo 'options nfs callback_tcpport=0' > /etc/modprobe.d/nfs-callback.conf
systemctl restart nfs-server
🧯 If You Can't Patch
- Disable NFS server entirely if not required
- Restrict NFS access to trusted clients only using firewall rules
🔍 How to Verify
Check if Vulnerable:
Check if NFS server is running and kernel version is vulnerable: 'systemctl status nfs-server' and 'uname -r'
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version after update and ensure NFS server restarted: 'uname -r' and check for fix commits in kernel changelog
📡 Detection & Monitoring
Log Indicators:
- Kernel logs showing 'refcount_t: underflow; use-after-free' or 'list_add corruption' messages
- NFS server crash logs
- System crashes during NFS operations
Network Indicators:
- Unexpected NFS connection failures
- NFSv4.1 callback connection attempts
SIEM Query:
source="kernel" AND ("refcount_t: underflow" OR "list_add corruption")
🔗 References
- https://git.kernel.org/stable/c/15fc60aa5bdcf6d5f93000d3d00579fc67632ee0
- https://git.kernel.org/stable/c/3bc8edc98bd43540dbe648e4ef91f443d6d20a24
- https://git.kernel.org/stable/c/707bcca9616002d204091ca7c4d1d91151104332
- https://git.kernel.org/stable/c/9b4ae8c42d2ff09ed7c5832ccce5684c55e5ed23
- https://git.kernel.org/stable/c/a472f069ced8601979f53c13c0cf20236074ed46
- https://git.kernel.org/stable/c/c1207219a4bfa50121c9345d5d165470d0a82531
- https://git.kernel.org/stable/c/d843ebd860c58a38e45527e8ec6516059f4c97f3
- https://git.kernel.org/stable/c/e2f9f03e4537f3fcc8fd2bdd3248530c3477a371
- https://git.kernel.org/stable/c/fddac3b4578d302ac9e51e7f03a9aae6254ae2a3