From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE633C4708A for ; Thu, 27 May 2021 16:10:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD1D0611CD for ; Thu, 27 May 2021 16:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236999AbhE0QMU (ORCPT ); Thu, 27 May 2021 12:12:20 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:45486 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235631AbhE0QMT (ORCPT ); Thu, 27 May 2021 12:12:19 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lmIaq-0042u2-QA; Thu, 27 May 2021 10:10:44 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1lmIaq-0006bf-3q; Thu, 27 May 2021 10:10:44 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Alexey Gladkov Cc: Yang Yingliang , linux-kernel@vger.kernel.org References: <20210526143805.2549649-1-yangyingliang@huawei.com> <20210527085613.7nnnh3ocwedvcntz@example.org> Date: Thu, 27 May 2021 11:10:27 -0500 In-Reply-To: <20210527085613.7nnnh3ocwedvcntz@example.org> (Alexey Gladkov's message of "Thu, 27 May 2021 10:56:13 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lmIaq-0006bf-3q;;;mid=;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19rdhmrMM1q8jhEbqc0V31SytS0QxGsnJY= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH -next] cred: add missing return error code when set_cred_ucounts() failed X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Gladkov writes: > On Wed, May 26, 2021 at 05:10:43PM -0500, Eric W. Biederman wrote: >> Yang Yingliang 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 >> > Signed-off-by: Yang Yingliang >> > --- >> > 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