Skip to content

Commit 92978c8

Browse files
q2venchucklever
authored andcommitted
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: 16a4711 ("NFSD: add listener-{set,get} netlink command") Cc: [email protected] Signed-off-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 1cb968a commit 92978c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfsd/nfsctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)
20002000
}
20012001

20022002
ret = svc_xprt_create_from_sa(serv, xcl_name, net, sa, 0,
2003-
get_current_cred());
2003+
current_cred());
20042004
/* always save the latest error */
20052005
if (ret < 0)
20062006
err = ret;

0 commit comments

Comments
 (0)