Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp482755lqb; Fri, 24 May 2024 04:48:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjW9eSyKEWI9+EtWA7hoyzVooz+/4KtFcWOVVv6EZn5Xyxvks4N5EAFGcsVGAJKBKWuFwseZc+wtQRxJH+TytfCrNGjbEXYl12Z1kPcQ== X-Google-Smtp-Source: AGHT+IFeDovs0FhhFrVloYFIl7KKCBwAwJcqkBhQaOYWvMh/Xw46JCpqFicInlDfx5aA6GHo0op8 X-Received: by 2002:a05:6214:5293:b0:6a9:d5c:73fd with SMTP id 6a1803df08f44-6ab8f3282famr79705726d6.2.1716551332023; Fri, 24 May 2024 04:48:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716551332; cv=pass; d=google.com; s=arc-20160816; b=mEm/d4F5dj2P8i51fkOY35IP+ZsgsOsBS4Ror9ZIVEAIFQsZX+Nlf7ZC95Y7pOBSKp eWTw5t/TYBBA0vWgcVXMXX5Mky0DwW6trgMxur3UBvoKP2FyTbM1o/inuguNqF5NskDy lLgabPRZ/Q1fjpE783YHtAXckQ4VRQNDtkp0LV2PrwGHFDYvchlZ1tjkNMXiMqksx9c9 jofpVjQs75enllt6AOz+fAjFh9vRCYKf9nwXRgVJRuOOkGz6T8/oAB6l9wZyAOaWZUWB HjUSh8uZum7wg33l0lJAsds0EQNt1szUuWRJ4KyuJPyRSIL3agHOnDh30xHHSQz7CBp0 gang== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=h5DfMk9c2TmzlxOpvFq0nvj6Y7AsLk9tvwnUrEfnKcM=; fh=gdSURPoG5o9lfGovgvsHDy62P4FvG6i6WWc5pDgZ8BE=; b=P1d0pzYbF/oArNa2Drj4gLqtYgfC1MU6SN7y/FCnecyoo9Du6S5Vnw3ot6YPjWTyl5 urj7GO9rJM/nihdC4tPq5Ijia6f2NSygIn8KkYpyc0xr33u64xDDR6H/Yq76mCX/vhHU BB9lvcJD/xxT4vQU0ulXObTPqDIrC49qt/7ELLpYXWxx4ZNflLgcZl2PDPbYjhuTUghV NCxwy9oJs/d6h+X4s/ornxCG3B1U1lUpxuU+6oU78UaJJ1TNlVlgp8Pgqbc0IrhBBagP ckfQCOl3eCBfSrRRq0DlW3yc8+MHYrSm8RO+OHFTOITFMEauKeCrxQO5lmEYuEji87p+ cl1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A8fdJMwO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-188656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac162ddf21si14153976d6.588.2024.05.24.04.48.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 04:48:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A8fdJMwO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-188656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188656-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BC78E1C20615 for ; Fri, 24 May 2024 11:48:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0C2586260; Fri, 24 May 2024 11:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A8fdJMwO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0476F8624B for ; Fri, 24 May 2024 11:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716551326; cv=none; b=d22zn4qjXbbA3y23KSNGi00MldUE96z4AXW1eJA5WqyAa1OdOBmVADc+uiBLq+RlxEB/t4JrAW3+QH/7HVEdTWEju7zcFK2JNXPVW+9Hekv/A4MajYfB1kWEQgP15Gbtp70hnf+WqH4pV7Z8gLgYWCLWlQnPpX/Bfw7U4Tj7RyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716551326; c=relaxed/simple; bh=gtWh5abJ4RgJ37MQ6UElH+W5h+wMAq5hU4/UmO3u/9A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XKI4Pd0nROmIOyyaiyeblLMWl2SWnSeANit7LqPeAoVASsiDVqStiTgWDPA12YdJ2IGMQb/1wR3up+z92XeCtHh+P9APwplfT82HznjzXzDQEK5O2vlrUUOOfDigUbe0jVgdiODEWgiNtWC/YIK+Im6M0gnx6wch//ljHWYqbiA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A8fdJMwO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67959C2BBFC; Fri, 24 May 2024 11:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716551325; bh=gtWh5abJ4RgJ37MQ6UElH+W5h+wMAq5hU4/UmO3u/9A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A8fdJMwOF/BdS+PKqLzkJsnS8IFYxWDcf3qG2Aeqa6aM8C3T8U0mSuJGnmQrBqHqt uZC8Rv9WOYZV5oD3sJUrIVL4NabgP+1oQe87a8YtsmCA5hVs5D6L72zFjns3fnctnj qYeisKCDgiHtCsPbe8o2GzEdRT1pPfZRAong+Q4VUlfsmdxU3jslgOGM2oRixc0DZ/ da4SxX126HNORHAgMx42m2NmMb9/kvdsOfQMhYiqo1tIk/5hByt7Xvxvd3N8dt8TTX Er1hcaXFxd66UQFOrHOnvw9KDTdGAQiyTGAHhiBcf7vwD1qryJUyyOvW9OgG2W9hjv hl5adCzxhlj+w== Date: Fri, 24 May 2024 13:48:40 +0200 From: Christian Brauner To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Daniel Lezcano , "Eric W . Biederman" , javier@dowhile0.org, Andrew Morton , "Gustavo A. R. Silva" , Masahiro Yamada , Nhat Pham , Petr Mladek , Randy Dunlap , Vincent Guittot , Yoann Congal Subject: Re: [PATCH] userns: Default to 'yes' when CONFIG_MEMCG option is enabled Message-ID: <20240524-beurkunden-kantig-101649d6b5cf@brauner> References: <20240524082434.657573-1-javierm@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240524082434.657573-1-javierm@redhat.com> On Fri, May 24, 2024 at 10:24:16AM +0200, Javier Martinez Canillas wrote: > The default value for the CONFIG_USER_NS Kconfig symbol changed over time. > > When first was introduced by commit acce292c82d4 ("user namespace: add the > framework"), the default was 'no'. But then it was changed to 'yes' if the > CONFIG_NAMESPACES option was enabled, by commit 17a6d4411a4d ("namespaces: > default all the namespaces to 'yes' when CONFIG_NAMESPACES is selected"). > > Then, commit 5673a94c1457 ("userns: Add a Kconfig option to enforce strict > kuid and kgid type checks") changed the default to 'no' again and selected > the (now defunct) UIDGID_STRICT_TYPE_CHECKS option. > > This selected option was removed by commit 261000a56b63 ("userns: Remove > UIDGID_STRICT_TYPE_CHECKS"), but CONFIG_USER_NS default was left to 'no'. > > Finally, the commit e11f0ae388f2 ("userns: Recommend use of memory control > groups") added to the Kconfig symbol's help text a recommendation that the > memory control groups should be used, to limit the amount of memory that a > user who can create user namespaces can consume. > > Looking at the changes' history, a default to 'yes' when the CONFIG_MEMCG > option is enabled seems like a sane thing to do. Specially since systemd > requires user namespaces support for services that use the PrivateUsers= > property in their unit files (e.g: the UPower daemon). Fyi, user namespaces are an entirely optional feature in systemd and it gracefully falls back if they are not available with PrivateUsers= set. If that isn't the case then it's a bug in systemd with PrivateUsers= handling and should be reported. But specifically to you change, afair CONFIG_MEMCG and userns are unrelated so tying them together like this in the kconfig seems misguided.