Browse Source

nfsd: fix cred leak on every rpc

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>
J. Bruce Fields 16 năm trước cách đây
mục cha
commit
b914152a6f
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      fs/nfsd/auth.c

+ 1 - 0
fs/nfsd/auth.c

@@ -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: