All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] cred: add missing return error code when set_cred_ucounts() failed
@ 2021-05-26 14:38 Yang Yingliang
  2021-05-26 22:10 ` Eric W. Biederman
  2021-05-28 21:22 ` Eric W. Biederman
  0 siblings, 2 replies; 6+ messages in thread
From: Yang Yingliang @ 2021-05-26 14:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: legion, ebiederm

If set_cred_ucounts() failed, we need return the error code.

Fixes: 905ae01c4ae2 ("Add a reference to ucounts for each cred")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 kernel/cred.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/cred.c b/kernel/cred.c
index db7c46bf36e5..e6fd2b3fc31f 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
 		ret = create_user_ns(new);
 		if (ret < 0)
 			goto error_put;
-		if (set_cred_ucounts(new) < 0)
+		ret = set_cred_ucounts(new);
+		if (ret < 0)
 			goto error_put;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-28 21:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 14:38 [PATCH -next] cred: add missing return error code when set_cred_ucounts() failed Yang Yingliang
2021-05-26 22:10 ` Eric W. Biederman
2021-05-27  8:56   ` Alexey Gladkov
2021-05-27 16:10     ` Eric W. Biederman
2021-05-28 11:40       ` Alexey Gladkov
2021-05-28 21:22 ` Eric W. Biederman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.