From patchwork Mon Sep 6 12:55:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 507878 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=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 6C268C433FE for ; Mon, 6 Sep 2021 12:57:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 568F261051 for ; Mon, 6 Sep 2021 12:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242546AbhIFM6K (ORCPT ); Mon, 6 Sep 2021 08:58:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:34444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242607AbhIFM5y (ORCPT ); Mon, 6 Sep 2021 08:57:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0409361039; Mon, 6 Sep 2021 12:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630933009; bh=iprgAoh1OvLLxlWYO7UmW3j7TzBZhhcCXbdNFYV+JV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kPH1iO5r4bfSFVAYcw6FMUnzKBEYTr9wrGSjdWayyW7UZOPpDdCteOun3YNyOF3aq r6mgOq4l3cXLl+sq9kXoIk/3d49CgPWde0e2wjDSwSbmWMTCwjv2Y6ObOnNtOuo9K2 mHBVP9XrYrN/lOBXXGdnv/LAeD6htW9GCSDOQK24= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Eric W. Biederman" , Yang Yingliang , Alexey Gladkov , Sasha Levin Subject: [PATCH 5.10 07/29] Revert "cred: add missing return error code when set_cred_ucounts() failed" Date: Mon, 6 Sep 2021 14:55:22 +0200 Message-Id: <20210906125450.027579655@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906125449.756437409@linuxfoundation.org> References: <20210906125449.756437409@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Greg Kroah-Hartman This reverts commit 0855952ed4f1a6861fbb0e5d684efd447d7347c9 which is commit 5e6b8a50a7cec5686ee2c4bda1d49899c79a7eae upstream. The "original" commit 905ae01c4ae2 ("Add a reference to ucounts for each cred"), should not have been applied to the 5.10.y tree, so revert it, and the follow-on fixup patches as well. Reported-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/87v93k4bl6.fsf@disp2133 Cc: Yang Yingliang Cc: Alexey Gladkov Cc: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/cred.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/cred.c +++ b/kernel/cred.c @@ -372,8 +372,7 @@ int copy_creds(struct task_struct *p, un ret = create_user_ns(new); if (ret < 0) goto error_put; - ret = set_cred_ucounts(new); - if (ret < 0) + if (set_cred_ucounts(new) < 0) goto error_put; }