[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m1h7imlfjr.fsf@fess.ebiederm.org>
Date: Fri, 28 May 2021 16:22:16 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: <linux-kernel@...r.kernel.org>, <legion@...nel.org>
Subject: Re: [PATCH -next] cred: add missing return error code when set_cred_ucounts() failed
Yang Yingliang <yangyingliang@...wei.com> writes:
> 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@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
Applied thanks.
> ---
> 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;
> }
Powered by blists - more mailing lists