Skip to content

Commit

Permalink
nfsd: fix cred leak on every rpc
Browse files Browse the repository at this point in the history
Since override_creds() took its own reference on new, we need to release
our own reference.

(Note the put_cred on the return value puts the *old* value of
current->creds, not the new passed-in value).

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
J. Bruce Fields authored and J. Bruce Fields committed Jan 27, 2009
1 parent bf935a7 commit b914152
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfsd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
new->cap_effective = cap_raise_nfsd_set(new->cap_effective,
new->cap_permitted);
put_cred(override_creds(new));
put_cred(new);
return 0;

oom:
Expand Down

0 comments on commit b914152

Please sign in to comment.