Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5969523pxb; Mon, 14 Feb 2022 11:59:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbsoWGSvmvJftgXnmM0bt6Nnl3kUT0W2Pla/8KFePCwiLVBt1Caim/sERtFjzB5ORX6v2V X-Received: by 2002:a17:902:ef47:: with SMTP id e7mr423593plx.73.1644868766307; Mon, 14 Feb 2022 11:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644868766; cv=none; d=google.com; s=arc-20160816; b=mjmnOZTLQW9zlBZRdEocQED3OGxvrk7k01pvuEUtLD6kArn2wdGaA4fUkO0AV26GUZ NyRvOWEZ9cdZnzkTNsrpMI74HOSerR4hmKNjW+hEswDLX4N8J9EACIGlhJMHgYwoubQB Gf057AzvpOfLUPhlrKiALMYWVEdBeYci4biM/kB/kSaO1ihs6NQD5J77MSGGbU5P7hiT OO6kQ+aVICFKwgpkVAoBrFPj1k2wtBS1fTjpO9GK+7ljfTuffswCRnd4Pkrp1balif2S x1nihMOSJBGecZxJesb2DGUtrbaljQZ8SJYoxQSGehwkW1NHThcp3x/y7CHYtV/pQuYU P4yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hcAP1oYRKlVZf+ejwok9nLI2R/eE64Eg/5Ilx8Cevaw=; b=pCyzhSGzqW4L8RW3zhqC4lvS8vAp2ZtcUchxOHemhipJX2HH/OlHGEZOH59h044IDq 9xCCtjjwX3rhOiMb17FntZvxfGGqxBsd25sJKfJh7QNDEO5+QiaFAzJR3jvy//EF35+d Hg2LcNlSAjdHkDAHthrTomEKK+1BqZ4xoVvkqw8x4kppTUsitC2XbXkINbPsGqxkjCev Wn6/guyjk238PZE4Xc1NY4iyoRNfplBmblLFG53xPkd5QggLas3rH5NJFys4qDHhk1co TheBLV0E+hYBsMwrxfOrgLwmLlQ+zha5FJ3AUSCeNbczNi0UrkUp/QZeKuyjIGRGd5ts M0sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mKoMck6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j11si15496615plx.12.2022.02.14.11.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:59:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mKoMck6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8FCC0142363; Mon, 14 Feb 2022 11:40:38 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357482AbiBNShj (ORCPT + 99 others); Mon, 14 Feb 2022 13:37:39 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232272AbiBNShj (ORCPT ); Mon, 14 Feb 2022 13:37:39 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF9160ABE; Mon, 14 Feb 2022 10:37:30 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2D80A1F38A; Mon, 14 Feb 2022 18:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1644863849; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hcAP1oYRKlVZf+ejwok9nLI2R/eE64Eg/5Ilx8Cevaw=; b=mKoMck6I7z0K8iD8TC1sp81Sq377hEFQ0MnsnbZj+N2a9zXv5vKRAHC6mPUFiHBBAS8faE 5OuPLV4QNi/EXTMWfaEsG0kiFbwM6EfutYXrIKrNAiw+1Kxghfi9dRG/wmtArgm4br+BdH 4TPyenKVQwpcIOGTeaKF1ZwQQmmEzSw= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0A97F13A85; Mon, 14 Feb 2022 18:37:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xsMQAmmhCmJNRAAAMHmgww (envelope-from ); Mon, 14 Feb 2022 18:37:29 +0000 Date: Mon, 14 Feb 2022 19:37:27 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: "Eric W. Biederman" Cc: linux-kernel@vger.kernel.org, Alexey Gladkov , Kees Cook , Shuah Khan , Christian Brauner , Solar Designer , Ran Xiaokai , containers@lists.linux-foundation.org, stable@vger.kernel.org Subject: Re: [PATCH 1/8] ucounts: Fix RLIMIT_NPROC regression Message-ID: <20220214183727.GA10803@blackbody.suse.cz> References: <87o83e2mbu.fsf@email.froward.int.ebiederm.org> <20220211021324.4116773-1-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220211021324.4116773-1-ebiederm@xmission.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 08:13:17PM -0600, "Eric W. Biederman" wrote: > This can be fixed either by fixing the test or by moving the increment > to be before the test. Fix it my moving copy_creds which contains > the increment before is_ucounts_overlimit. This is simpler than my approach and I find it correct too. > Both the test in fork and the test in set_user were semantically > changed when the code moved to ucounts. The change of the test in > fork was bad because it was before the increment. > > The test in set_user was wrong and the change to ucounts fixed it. So > this fix is only restore the old behavior in one lcatio not two. Whom should be the task accounted to in the case of set*uid? (The change to ucounts made the check against the pre-switch user's ucounts.) > --- > kernel/fork.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Michal Koutn?