lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 24 May 2024 10:24:16 +0200
From: Javier Martinez Canillas <javierm@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>,
	"Eric W . Biederman" <ebiederm@...ssion.com>,
	javier@...hile0.org,
	Christian Brauner <brauner@...nel.org>,
	Javier Martinez Canillas <javierm@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Gustavo A. R. Silva" <gustavoars@...nel.org>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Nhat Pham <nphamcs@...il.com>,
	Petr Mladek <pmladek@...e.com>,
	Randy Dunlap <rdunlap@...radead.org>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Yoann Congal <yoann.congal@...le.fr>
Subject: [PATCH] userns: Default to 'yes' when CONFIG_MEMCG option is enabled

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).

Signed-off-by: Javier Martinez Canillas <javierm@...hat.com>
---

 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index 72404c1f2157..208e2f500ef0 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1239,6 +1239,7 @@ config IPC_NS
 
 config USER_NS
 	bool "User namespace"
+	default y if MEMCG
 	default n
 	help
 	  This allows containers, i.e. vservers, to use user namespaces
-- 
2.45.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ