Received: by 2002:a05:6512:23a5:0:0:0:0 with SMTP id c37csp485322lfv; Tue, 15 Feb 2022 07:08:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+0pDYyGzDEIWXloDOrfoj1CYxUhLMO32haqY2dQUb/qLOzfOXObOftFBeCHIm883cx4Pp X-Received: by 2002:a05:6870:c087:b0:ce:c0c9:675 with SMTP id c7-20020a056870c08700b000cec0c90675mr1474458oad.199.1644937680512; Tue, 15 Feb 2022 07:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644937680; cv=none; d=google.com; s=arc-20160816; b=ZSmLFKs2q/G8g6CwM5Bq5K1aWk+mUgl2ac0RRrmnQqSoRaDuXTQcoJDntQGZ4Sayo1 6ZZIdQfayAdLtNWg37Jd//tP6xB2yMfRftCqB5iraQL22YKaSEnHvlHDpfYVP0uQtW4J gdjDEXhJXJwPDuGWvBX5whH9XTQxa4dFtWGbGhyhXXcej9lt0aA6fv2tqd1+5UcbG9nD fM8in6rQFBrYdfdDZc+vSJ7Tw7geofKY0ADjv6VHG3dfq9PG5cRq+yx1MIWSyepVb+AX zDQTXtqXUdhSzC13M5rP+rwWQMQ8RrCbPT7sBTUm16wrkJjwCVqdO7U1rnH0OniZUFPs AjOA== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pw068fBCazlz3BwNkc7tJOJSYYz5n2wbrWj8hk+Qk0c=; b=AA8Wd4vK9lKcZV0JkLbnovi9IAGbD7rHyOBejDcckSMBhi8Pa0/4beYZkdoOHtqsZD vGAwuIDxiDey49S4ncRzt1hk7AsOKXxmayMyTFfGk/E7SF9NvL2wjdM/e5ws2Om22JjE Ge9mC6uTQT41eby6cS5iM90OZCYVT1q8s4s3x1Pv+ScrTAZqTpx2KJsTa6sv2dQLIe1T GTLPteTnhQP9fi+TPLqcuSr7iZ17Bdo8UqKwe3c4yL+nBgn/w00xqNDj/ZdEp7w9OtZx rxEQD0/jhJ0wqtwxDNm5bnGRA0et6sqLLf3HGN8q2F/9Yv0DvwTngwS1k0SXEA0URGAP uW6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="FIzh/mtX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6si12120161oil.291.2022.02.15.07.07.45; Tue, 15 Feb 2022 07:08:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="FIzh/mtX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237121AbiBOLiB (ORCPT + 99 others); Tue, 15 Feb 2022 06:38:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236631AbiBOLiA (ORCPT ); Tue, 15 Feb 2022 06:38:00 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F19B314027 for ; Tue, 15 Feb 2022 03:37:50 -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-out1.suse.de (Postfix) with ESMTPS id 84FC3210F9; Tue, 15 Feb 2022 11:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1644925069; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pw068fBCazlz3BwNkc7tJOJSYYz5n2wbrWj8hk+Qk0c=; b=FIzh/mtXss78WLaVXZ0p+HyizHWcg1OAgoO6jXye2Vs5V8A097HKb1BZctnDXeX7Nf4yCM /XwyoX/oLX6WDJsx7IB94As3hox/18NtQN2YE+uFhopBjerQCinyBRmkjVBeQ6imjJmwwa VKEqNYnrhUm7zQabflbD5olbqc6kMqE= 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 5F57313C40; Tue, 15 Feb 2022 11:37:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UgY1Fo2QC2KnQwAAMHmgww (envelope-from ); Tue, 15 Feb 2022 11:37:49 +0000 Date: Tue, 15 Feb 2022 12:37:48 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Shuah Khan Cc: "Eric W. Biederman" , linux-kernel@vger.kernel.org, Alexey Gladkov , Kees Cook , Shuah Khan , Christian Brauner , Solar Designer , Ran Xiaokai , Linux Containers Subject: Re: [PATCH 0/8] ucounts: RLIMIT_NPROC fixes Message-ID: <20220215113748.GI21589@blackbody.suse.cz> References: <20220207121800.5079-1-mkoutny@suse.com> <87o83e2mbu.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Feb 11, 2022 at 11:22:13AM -0700, Shuah Khan wrote: > Do we need updates to selftests - Michal's patch series included changes to > selftests/exec In my understanding the original rlimits-per-userns.c covers an invalid use case -- clone(0);setuid();unshare(CLONE_NEWUSER) -- where the created user_ns is owned by unprivileged user and the global RLIMIT_NPROC cannot be breached. My patched variant retains this use-case (should fail) and adds clone(CLONE_NEWUSER);setuid() [1] variant which should be the valid use-case for per-user per-user-ns RLIMIT_NPROC. Michal [1] In this situation theoretically equivalent to clone(0);unshare(CLONE_NEWUSER);setuid().