CVE-2026-99763: 9p: don't decrement a server-owned zero nlink
In the Linux kernel, the following vulnerability has been resolved:
9p: don't decrement a server-owned zero nlink
A 9P2000.L server can report nlink=0 for a regular file that still exists. On a cache=loose or cache=fscache mount, lookup stores that value with setnlink(). A later successful unlink calls v9fsdeccount(), which still calls dropnlink() for a non-directory. dropnlink() warns, and the unsigned link count wraps to 4294967295. fstat() on a descriptor opened before the unlink shows 0 before and 4294967295 after.
The warning on the unpatched kernel, trimmed:
WARNING: fs/inode.c:408 at dropnlink+0xac/0xd0, CPU#1: trigger/188 CPU: 1 UID: 0 PID: 188 Comm: trigger Tainted: G N 7.3.0-rc4-00537-ga3ff15db6820 #1 PREEMPT(lazy) RIP: 0010:dropnlink+0xac/0xd0 Call Trace: <TASK> v9fsremove+0x529/0x750 vfsunlink+0x2f0/0xbd0 filenameunlinkat+0x340/0x6c0 x64sysunlink+0x46/0x70 dosyscall64+0xe8/0x4f0 entrySYSCALL64afterhwframe+0x77/0x7f </TASK> ---[ end trace 0000000000000000 ]---
Directories whose cached nlink is at most 2 already skip this decrement, because the exported filesystem may not maintain nlink (commit ac89b2ef9b559). cache=none skips it as well (commit 574aa0b479947). cache=mmap does not take this path: it sets neither CACHEMETA nor CACHELOOSE. A regular file on cache=loose or cache=fscache still does. Its count came from GETATTR and may already be zero, so skip the decrement when inlink is already 0.
Verified on 7.3-rc4-00537-ga3ff15db6820 with only this change. A server that advertises nlink=0 and accepts the unlink no longer warns, and the open descriptor stays at nlink 0. An honest server on the same mount still goes from 1 to 0. A rejected unlink leaves the count unchanged. cache=none is unchanged. With paniconwarn the unpatched kernel panics on the warning; the patched kernel does not.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch ac89b2ef9b559
Frequently Asked Questions
Which systems are affected by this issue?
Systems using Linux kernel 9P2000.L client mounts with cache=loose or cache=fscache may be affected when the server reports nlink=0 for an existing regular file. Mounts using cache=none do not take the affected decrement path.
What is required to trigger the issue?
A 9P2000.L server must report a zero link count for a regular file that still exists. After that value is cached, a successful unlink of the file triggers the invalid link-count decrement.
How can I determine whether an unpatched system has encountered it?
An affected kernel emits a WARNING from drop_nlink in fs/inode.c during unlink, with v9fs_remove and vfs_unlink in the call trace. A file descriptor opened before unlink can report nlink=0 before unlink and 4294967295 afterward.
What mitigation is available if the kernel cannot be updated immediately?
Use cache=none for the affected 9P mount rather than cache=loose or cache=fscache. This avoids the affected decrement path.