瀏覽代碼

nfsd: fix null dereference on error path

We're forgetting to check the return value from groups_alloc().

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
J. Bruce Fields 16 年之前
父節點
當前提交
bf935a7881
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/nfsd/auth.c

+ 2 - 0
fs/nfsd/auth.c

@@ -49,6 +49,8 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
 		new->fsuid = exp->ex_anon_uid;
 		new->fsgid = exp->ex_anon_gid;
 		gi = groups_alloc(0);
+		if (!gi)
+			goto oom;
 	} else if (flags & NFSEXP_ROOTSQUASH) {
 		if (!new->fsuid)
 			new->fsuid = exp->ex_anon_uid;