提交 b914152a 编写于 作者: J J. Bruce Fields 提交者: J. Bruce Fields

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: NJ. Bruce Fields <bfields@citi.umich.edu>
上级 bf935a78
...@@ -87,6 +87,7 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp) ...@@ -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_effective = cap_raise_nfsd_set(new->cap_effective,
new->cap_permitted); new->cap_permitted);
put_cred(override_creds(new)); put_cred(override_creds(new));
put_cred(new);
return 0; return 0;
oom: oom:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册