提交 48e6f355 编写于 作者: Y Yang Yingliang 提交者: Zheng Zengkai

cred: add missing return error code when set_cred_ucounts() failed

stable inclusion
from stable-5.10.50
commit 0855952ed4f1a6861fbb0e5d684efd447d7347c9
bugzilla: 174522 https://gitee.com/openeuler/kernel/issues/I4DNFY

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0855952ed4f1a6861fbb0e5d684efd447d7347c9

--------------------------------

commit 5e6b8a50 upstream.

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

Fixes: 905ae01c ("Add a reference to ucounts for each cred")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Link: https://lkml.kernel.org/r/20210526143805.2549649-1-yangyingliang@huawei.comReviewed-by: NAlexey Gladkov <legion@kernel.org>
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 4e2cd8e6
...@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags) ...@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
ret = create_user_ns(new); ret = create_user_ns(new);
if (ret < 0) if (ret < 0)
goto error_put; goto error_put;
if (set_cred_ucounts(new) < 0) ret = set_cred_ucounts(new);
if (ret < 0)
goto error_put; goto error_put;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册