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

nfsd: fix null dereference on error path

We're forgetting to check the return value from groups_alloc().
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
上级 ce0cf662
...@@ -49,6 +49,8 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp) ...@@ -49,6 +49,8 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
new->fsuid = exp->ex_anon_uid; new->fsuid = exp->ex_anon_uid;
new->fsgid = exp->ex_anon_gid; new->fsgid = exp->ex_anon_gid;
gi = groups_alloc(0); gi = groups_alloc(0);
if (!gi)
goto oom;
} else if (flags & NFSEXP_ROOTSQUASH) { } else if (flags & NFSEXP_ROOTSQUASH) {
if (!new->fsuid) if (!new->fsuid)
new->fsuid = exp->ex_anon_uid; new->fsuid = exp->ex_anon_uid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册