Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Kuniyuki Iwashima and committed by
Chuck Lever
92978c83 1cb968a2

+1 -1
+1 -1
fs/nfsd/nfsctl.c
··· 2000 2000 } 2001 2001 2002 2002 ret = svc_xprt_create_from_sa(serv, xcl_name, net, sa, 0, 2003 - get_current_cred()); 2003 + current_cred()); 2004 2004 /* always save the latest error */ 2005 2005 if (ret < 0) 2006 2006 err = ret;