public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Alexey Gladkov <legion@kernel.org>
Cc: Yang Yingliang <yangyingliang@huawei.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] cred: add missing return error code when set_cred_ucounts() failed
Date: Thu, 27 May 2021 11:10:27 -0500	[thread overview]
Message-ID: <m1mtsgkvik.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20210527085613.7nnnh3ocwedvcntz@example.org> (Alexey Gladkov's message of "Thu, 27 May 2021 10:56:13 +0200")

Alexey Gladkov <legion@kernel.org> writes:

> On Wed, May 26, 2021 at 05:10:43PM -0500, Eric W. Biederman wrote:
>> Yang Yingliang <yangyingliang@huawei.com> writes:
>> 
>> > If set_cred_ucounts() failed, we need return the error code.
>> 
>> Alex how does this look to you?
>> 
>> This is showing up now as I have finally dropped the code in linux-next
>> and other people are looking at it.
>> 
>> At a quick fix looks correct to me.
>
> Yes, this is the right fix. I miss it.


Can I have your Acked-by or Reviewed-by.
Thank you.

>> > 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;
>> >  	}
>> 

Eric

  reply	other threads:[~2021-05-27 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-05-28 11:40       ` Alexey Gladkov
2021-05-28 21:22 ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1mtsgkvik.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox