{"id":"CVE-2026-23297","state":"PUBLISHED","title":"nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().\n\nsyzbot reported memory leak of struct cred. [0]\n\nnfsd_nl_threads_set_doit() passes get_current_cred() to\nnfsd_svc(), but put_cred() is not called after that.\n\nThe cred is finally passed down to _svc_xprt_create(),\nwhich calls get_cred() with the cred for struct svc_xprt.\n\nThe ownership of the refcount by get_current_cred() is not\ntransferred to anywhere and is just leaked.\n\nnfsd_svc() is also called from write_threads(), but it does\nnot bump file->f_cred there.\n\nnfsd_nl_threads_set_doit() is called from sendmsg() and\ncurrent->cred does not go away.\n\nLet's use current_cred() in nfsd_nl_threads_set_doit().\n\n[0]:\nBUG: memory leak\nunreferenced object 0xffff888108b89480 (size 184):\n  comm \"syz-executor\", pid 5994, jiffies 4294943386\n  hex dump (first 32 bytes):\n    01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n  backtrace (crc 369454a7):\n    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]\n    slab_post_alloc_hook mm/slub.c:4958 [inline]\n    slab_alloc_node mm/slub.c:5263 [inline]\n    kmem_cache_alloc_noprof+0x412/0x580 mm/slub.c:5270\n    prepare_creds+0x22/0x600 kernel/cred.c:185\n    copy_creds+0x44/0x290 kernel/cred.c:286\n    copy_process+0x7a7/0x2870 kernel/fork.c:2086\n    kernel_clone+0xac/0x6e0 kernel/fork.c:2651\n    __do_sys_clone+0x7f/0xb0 kernel/fork.c:2792\n    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\n    do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94\n    entry_SYSCALL_64_after_hwframe+0x77/0x7f","publishedAt":"2026-03-25T10:26:54.156Z","updatedAt":"2026-05-11T22:04:09.525Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"41170716421c25cd20b39e83f0e0762e212b377b","versionType":"git"},{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"27c13c5bb0948e3b5c64e59f8a903231896fab9b","versionType":"git"},{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"a3f88e3e18b51a7f654189189c762ebcdeaa7e29","versionType":"git"},{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"1cb968a2013ffa8112d52ebe605009ea1c6a582c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/nfsctl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.77","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.17","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.7","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/nfsctl.c"]}],"references":["https://git.kernel.org/stable/c/41170716421c25cd20b39e83f0e0762e212b377b","https://git.kernel.org/stable/c/27c13c5bb0948e3b5c64e59f8a903231896fab9b","https://git.kernel.org/stable/c/a3f88e3e18b51a7f654189189c762ebcdeaa7e29","https://git.kernel.org/stable/c/1cb968a2013ffa8112d52ebe605009ea1c6a582c"],"weaknesses":[],"ingestedAt":"2026-10-29T20:11:21.040Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/23xxx/CVE-2026-23297.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-23297","state":"PUBLISHED","datePublished":"2026-03-25T10:26:54.156Z","dateUpdated":"2026-05-11T22:04:09.525Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-01-13T15:37:45.993Z"},"containers":{"cna":{"title":"nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().\n\nsyzbot reported memory leak of struct cred. [0]\n\nnfsd_nl_threads_set_doit() passes get_current_cred() to\nnfsd_svc(), but put_cred() is not called after that.\n\nThe cred is finally passed down to _svc_xprt_create(),\nwhich calls get_cred() with the cred for struct svc_xprt.\n\nThe ownership of the refcount by get_current_cred() is not\ntransferred to anywhere and is just leaked.\n\nnfsd_svc() is also called from write_threads(), but it does\nnot bump file->f_cred there.\n\nnfsd_nl_threads_set_doit() is called from sendmsg() and\ncurrent->cred does not go away.\n\nLet's use current_cred() in nfsd_nl_threads_set_doit().\n\n[0]:\nBUG: memory leak\nunreferenced object 0xffff888108b89480 (size 184):\n  comm \"syz-executor\", pid 5994, jiffies 4294943386\n  hex dump (first 32 bytes):\n    01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n  backtrace (crc 369454a7):\n    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]\n    slab_post_alloc_hook mm/slub.c:4958 [inline]\n    slab_alloc_node mm/slub.c:5263 [inline]\n    kmem_cache_alloc_noprof+0x412/0x580 mm/slub.c:5270\n    prepare_creds+0x22/0x600 kernel/cred.c:185\n    copy_creds+0x44/0x290 kernel/cred.c:286\n    copy_process+0x7a7/0x2870 kernel/fork.c:2086\n    kernel_clone+0xac/0x6e0 kernel/fork.c:2651\n    __do_sys_clone+0x7f/0xb0 kernel/fork.c:2792\n    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\n    do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94\n    entry_SYSCALL_64_after_hwframe+0x77/0x7f"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"41170716421c25cd20b39e83f0e0762e212b377b","versionType":"git"},{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"27c13c5bb0948e3b5c64e59f8a903231896fab9b","versionType":"git"},{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"a3f88e3e18b51a7f654189189c762ebcdeaa7e29","versionType":"git"},{"version":"924f4fb003ba114c60b3c07a011dcd86a8956cd1","status":"affected","lessThan":"1cb968a2013ffa8112d52ebe605009ea1c6a582c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/nfsctl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.77","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.17","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.7","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/nfsctl.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/41170716421c25cd20b39e83f0e0762e212b377b"},{"url":"https://git.kernel.org/stable/c/27c13c5bb0948e3b5c64e59f8a903231896fab9b"},{"url":"https://git.kernel.org/stable/c/a3f88e3e18b51a7f654189189c762ebcdeaa7e29"},{"url":"https://git.kernel.org/stable/c/1cb968a2013ffa8112d52ebe605009ea1c6a582c"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T22:04:09.525Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.12.77"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.18.17"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.19.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"7.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}