Locking Down Linux NFS Servers After NFS2ROOT (CVE-2026-99362): Finding nfsd Hosts, Proving the Running Kernel Is Fixed, Fencing Port 2049 and Disabling NFSv4.1/4.2 Until Reboot

A hands-on guide to finding every Linux host running the in-kernel NFS server, confirming the NFS2ROOT fix is in the running kernel on RHEL, Debian and Ubuntu, limiting port 2049 to known clients with firewalld, ufw or nftables, and using the NFSv4.1/4.2 switch as a stopgap until reboot.
NFS2ROOT (CVE-2026-99362) is an out-of-bounds write in the Linux kernel's built-in NFS server, nfsd. It sits in NFSv4.1 session handling: a client can negotiate the cached reply size down to the minimum, and the SEQUENCE reply then overruns a zero-length slot buffer. The bug has been in the kernel since 3.16 (2014). The kernel CNA scores it CVSS 9.8, and Red Hat scores it 9.4. It needs no authentication. Fixes have been out since the CVE record was published on 19 November 2026, but distribution status is still uneven. When this guide was written, Ubuntu still listed most of its supported releases as vulnerable.
Our earlier news article covered what the bug is. This tutorial is the hands-on part. You will find every host in your estate that actually runs nfsd, check whether its running kernel carries the fix, and close port 2049 to everyone except known clients. Where you cannot reboot yet, you will turn off NFSv4.1 and 4.2 as a stopgap. At the end you will review your exports so the next nfsd bug finds a smaller target.
Prerequisites
- Root or sudo access to the Linux servers you manage, plus a list of their NFS clients (subnets or addresses).
- A maintenance window for at least one reboot per NFS server. A kernel fix only takes effect after a reboot. Restarting
nfs-serveron the old kernel leaves the vulnerable code running. nfs-utils(RHEL family) ornfs-kernel-server(Debian/Ubuntu) on the servers, which gives youexportfs,rpc.nfsdandnfsstat.- Your distribution's security tracker open for the CVE: Red Hat, Ubuntu, Debian or SUSE (links in Sources).
- Authorization: only scan networks you own or are explicitly allowed to test.
Step 1: Find Every Host That Runs nfsd
Red Hat says default RHEL installs do not run nfsd, so exposure is limited to machines that someone set up to export shares. The problem is that those machines are easy to forget: an old file server, a Kubernetes node backing an NFS provisioner, a NAS built on a stock Linux kernel.
On each host, check the service and the kernel module:
systemctl is-active nfs-server 2>/dev/null || systemctl is-active nfs-kernel-server
lsmod | grep -w nfsd
ss -tln 'sport = :2049'
nfsd runs inside the kernel, so ss shows a listening socket on 2049 with no owning process. If a listener is there, the server is live. Another way to tell is the nfsd control filesystem:
cat /proc/fs/nfsd/versions
Output such as +3 +4 +4.1 +4.2 means NFSv4.1 and 4.2 are enabled, and those are the versions this bug needs.
To sweep a network you are authorized to scan, list the hosts that answer on TCP 2049:
nmap -Pn -p 2049 --open -oG - 10.0.0.0/16 | awk '/2049\/open/{print $2}' > nfs-hosts.txt
wc -l nfs-hosts.txt
Treat anything in that file that is not a known NFS server as an incident to look into, not just an item on the patch list.
Step 2: Confirm the Running Kernel Is Fixed
The upstream fixed releases per stable branch are 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.61 and 7.3.2, plus mainline 7.4-rc1. Distribution kernels backport fixes under their own version numbers, so don't compare uname -r against that list. Ask the package manager instead.
On RHEL, Rocky, AlmaLinux and Fedora:
uname -r
sudo dnf updateinfo list --cve CVE-2026-99362
rpm -q --changelog kernel-core-$(uname -r) | grep -c CVE-2026-99362
A count of 0 for the running kernel means the fix is not in the code you are running.
On Debian:
uname -r
apt changelog linux-image-$(uname -r) 2>/dev/null | grep -m1 CVE-2026-99362
Debian's tracker lists trixie as fixed in 6.12.117-1, bookworm-security as fixed in 6.1.192-3, and the bookworm linux-6.12 backport as fixed in 6.12.117-1~deb12u1.
On Ubuntu, the Pro client can report on (and fix) a single CVE:
pro fix CVE-2026-99362 --dry-run
If you installed the patched kernel but haven't rebooted, you are still exposed. Check whether a reboot is pending:
# RHEL family (dnf-utils / yum-utils)
sudo needs-restarting -r
# Debian / Ubuntu
[ -f /var/run/reboot-required ] && cat /var/run/reboot-required
Step 3: Turn the Service Off Where Nobody Needs It
Red Hat's first mitigation is the simplest one. If a host doesn't need to serve NFS, stop and disable the server:
sudo systemctl stop nfs-server
sudo systemctl disable nfs-server
Debian and Ubuntu use nfs-kernel-server as the unit name. Stopping the service ends active NFS sessions, so check nfsstat -s and the client list in Step 6 first. Do not stop it in the middle of a backup job.
Step 4: Restrict Port 2049 to Known Clients
For servers that must stay up until their reboot window, the interim measure that both the vendor and the researchers recommend is to allow 2049 only from trusted clients. Replace 10.0.20.0/24 with your real client range.
With firewalld (RHEL family), remove the open nfs service and add a rich rule for the client subnet:
sudo firewall-cmd --permanent --remove-service=nfs
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.20.0/24" service name="nfs" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
With ufw (Ubuntu):
sudo ufw allow from 10.0.20.0/24 to any port 2049 proto tcp
sudo ufw deny 2049/tcp
sudo ufw status numbered
ufw applies rules in order, so make sure the allow line comes before the deny line in the numbered output.
With plain nftables, put a dedicated table in front of everything else:
sudo nft add table inet nfsguard
sudo nft add chain inet nfsguard input '{ type filter hook input priority -10 ; policy accept ; }'
sudo nft add set inet nfsguard nfs_clients '{ type ipv4_addr ; flags interval ; }'
sudo nft add element inet nfsguard nfs_clients '{ 10.0.20.0/24 }'
sudo nft add rule inet nfsguard input tcp dport 2049 ip saddr @nfs_clients accept
sudo nft add rule inet nfsguard input tcp dport 2049 drop
sudo nft list table inet nfsguard
This ruleset is not persistent. Once it behaves correctly, add it to /etc/nftables.conf. It also does not cover IPv6: if the server has a routable IPv6 address, add an ipv6_addr set or drop IPv6 traffic to 2049 entirely.
Also check the cloud layer. A security group or network ACL that allows 2049 from 0.0.0.0/0 defeats a careful host firewall the day someone flushes it.
Step 5: Stopgap — Disable NFSv4.1 and 4.2 Until You Can Reboot
The researchers list a second interim option: switch off NFSv4.1 and 4.2, because the vulnerable code is in the 4.1 session machinery. In /etc/nfs.conf, the [nfsd] section accepts Boolean vers4.1 and vers4.2 keys:
[nfsd]
vers4.1=n
vers4.2=n
Apply the change and confirm it:
sudo systemctl restart nfs-server
cat /proc/fs/nfsd/versions
You should now see -4.1 -4.2. On older systems that start the daemon with flags, rpc.nfsd -N 4.1 -N 4.2 does the same thing.
Know the cost before you do this. Modern clients mount 4.2 by default and will fall back to 4.0 or v3 if allowed. Clients pinned with vers=4.2 in /etc/fstab or in a Kubernetes PersistentVolume will fail to mount. Features such as server-side copy also go away. The upstream advisory does not say whether NFSv4.0 or v3 are safe paths, so treat this step as a way to shrink the attack surface and buy time, not as a fix. Remove these lines after you reboot into a patched kernel.
Step 6: Review Exports and Clients
While you're in there, cut down what each server offers. List the live exports and their options:
sudo exportfs -v
Look for wildcard clients (* or 0.0.0.0/0), no_root_squash, insecure, and exports of / or home directories that nobody uses. Narrow each line in /etc/exports to named hosts or subnets, then apply without a restart:
sudo exportfs -ra
On kernels from 5.3 onward, nfsd lists connected NFSv4 clients under /proc/fs/nfsd/clients:
sudo sh -c 'for f in /proc/fs/nfsd/clients/*/info; do echo "== $f"; cat "$f"; done'
Each entry shows the client address and the minor version it negotiated. Any address outside your client list is worth investigating. One limit to keep in mind: sec=krb5 exports are good practice, but this bug is reachable without authentication (the CVSS vector is PR:N). Kerberos will not protect an unpatched server from it.
Verification
From a host that is not on the allow list, the port should now be filtered:
nmap -Pn -p 2049 nfs-server.example.internal
From an allowed client, a mount should still work:
sudo mount -t nfs -o vers=4.2 nfs-server.example.internal:/export /mnt && ls /mnt && sudo umount /mnt
After the reboot, run the Step 2 checks again. uname -r should report the patched kernel, and the changelog count should be non-zero.
Troubleshooting
- Clients hang after the firewall change. NFSv3 clients also need rpcbind (111) and mountd. Allow those from the same subnet, or move the clients to NFSv4, which only needs 2049.
/proc/fs/nfsd/versionsis missing. The nfsd filesystem isn't mounted, which usually means the server never started. Check withmount | grep nfsd.vers4.1=nseems to be ignored. Make sure the key sits under the[nfsd]section and not[mountd]. Settings in/etc/nfs.conf.d/*.confoverride the main file.- Kubernetes NFS provisioners. In-cluster NFS server pods use the node's kernel nfsd. Patch and reboot the node (drain it first), not the container image.
Wrapping Up
NFS2ROOT is a reminder that the kernel is the server: there is no daemon to update, and no fix takes effect without a reboot. List every host listening on 2049, confirm the running kernel through the package changelog, limit the port to known clients, and use the NFSv4.1/4.2 switch only as a short bridge to the reboot. Once your exports are narrowed and the client list is checked, the next nfsd bug will reach far fewer servers.
