CVE-2026-23297: nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().
In the Linux kernel, the following vulnerability has been resolved:
nfsd: Fix cred ref leak in nfsdnlthreadssetdoit().
syzbot reported memory leak of struct cred. [0]
nfsdnlthreadssetdoit() passes getcurrentcred() to nfsdsvc(), but putcred() is not called after that.
The cred is finally passed down to svcxprtcreate(), which calls getcred() with the cred for struct svcxprt.
The ownership of the refcount by getcurrentcred() is not transferred to anywhere and is just leaked.
nfsdsvc() is also called from writethreads(), but it does not bump file->fcred there.
nfsdnlthreadssetdoit() is called from sendmsg() and current->cred does not go away.
Let's use currentcred() in nfsdnlthreadssetdoit().
[0]: BUG: memory leak unreferenced object 0xffff888108b89480 (size 184): comm "syz-executor", pid 5994, jiffies 4294943386 hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc 369454a7): kmemleakallocrecursive include/linux/kmemleak.h:44 [inline] slabpostallochook mm/slub.c:4958 [inline] slaballocnode mm/slub.c:5263 [inline] kmemcacheallocnoprof+0x412/0x580 mm/slub.c:5270 preparecreds+0x22/0x600 kernel/cred.c:185 copycreds+0x44/0x290 kernel/cred.c:286 copyprocess+0x7a7/0x2870 kernel/fork.c:2086 kernelclone+0xac/0x6e0 kernel/fork.c:2651 dosysclone+0x7f/0xb0 kernel/fork.c:2792 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0xa4/0xf80 arch/x86/entry/syscall64.c:94 entrySYSCALL64afterhwframe+0x77/0x7f
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.85-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.19.8-1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.77 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.17 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.19.7 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.4-1Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What level of access does an attacker need?
The CVSS vector indicates local access and low privileges are required. No user interaction is required.
What is the expected security impact?
The issue leaks references to struct cred, causing a memory leak. The CVSS assessment indicates high availability impact, with no confidentiality or integrity impact.
What activity triggers the leak?
The leak occurs when nfsd_nl_threads_set_doit() passes get_current_cred() to nfsd_svc() while configuring NFSD threads through its netlink path. The untransferred credential reference is not released.
Is a fix available?
Yes. A patch is available, with stable-kernel commit references provided.