]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nfsd: Fix cred ref leak in nfsd_nl_listener_set_doit().
authorKuniyuki Iwashima <kuniyu@google.com>
Sat, 24 Jan 2026 04:18:41 +0000 (04:18 +0000)
committerChuck Lever <chuck.lever@oracle.com>
Sat, 14 Feb 2026 17:50:24 +0000 (12:50 -0500)
commit92978c83bb4eef55d02a6c990c01c423131eefa7
tree48235ad450b61187ad66aab6feb93938b362d025
parent1cb968a2013ffa8112d52ebe605009ea1c6a582c
nfsd: Fix cred ref leak in nfsd_nl_listener_set_doit().

nfsd_nl_listener_set_doit() uses get_current_cred() without
put_cred().

As we can see from other callers, svc_xprt_create_from_sa()
does not require the extra refcount.

nfsd_nl_listener_set_doit() is always in the process context,
sendmsg(), and current->cred does not go away.

Let's use current_cred() in nfsd_nl_listener_set_doit().

Fixes: 16a471177496 ("NFSD: add listener-{set,get} netlink command")
Cc: stable@vger.kernel.org
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c