mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
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: 16a4711774 ("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>
This commit is contained in:
parent
1cb968a201
commit
92978c83bb
1 changed files with 1 additions and 1 deletions
|
|
@ -2000,7 +2000,7 @@ int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)
|
|||
}
|
||||
|
||||
ret = svc_xprt_create_from_sa(serv, xcl_name, net, sa, 0,
|
||||
get_current_cred());
|
||||
current_cred());
|
||||
/* always save the latest error */
|
||||
if (ret < 0)
|
||||
err = ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue