|author||Iulia Manda <email@example.com>||2015-04-15 16:16:41 -0700|
|committer||Linus Torvalds <firstname.lastname@example.org>||2015-04-15 16:35:22 -0700|
kernel: conditionally support non-root users, groups and capabilities
There are a lot of embedded systems that run most or all of their functionality in init, running as root:root. For these systems, supporting multiple users is not necessary. This patch adds a new symbol, CONFIG_MULTIUSER, that makes support for non-root users, non-root groups, and capabilities optional. It is enabled under CONFIG_EXPERT menu. When this symbol is not defined, UID and GID are zero in any possible case and processes always have all capabilities. The following syscalls are compiled out: setuid, setregid, setgid, setreuid, setresuid, getresuid, setresgid, getresgid, setgroups, getgroups, setfsuid, setfsgid, capget, capset. Also, groups.c is compiled out completely. In kernel/capability.c, capable function was moved in order to avoid adding two ifdef blocks. This change saves about 25 KB on a defconfig build. The most minimal kernels have total text sizes in the high hundreds of kB rather than low MB. (The 25k goes down a bit with allnoconfig, but not that much. The kernel was booted in Qemu. All the common functionalities work. Adding users/groups is not possible, failing with -ENOSYS. Bloat-o-meter output: add/remove: 7/87 grow/shrink: 19/397 up/down: 1675/-26325 (-24650) [email@example.com: coding-style fixes] Signed-off-by: Iulia Manda <firstname.lastname@example.org> Reviewed-by: Josh Triplett <email@example.com> Acked-by: Geert Uytterhoeven <firstname.lastname@example.org> Tested-by: Paul E. McKenney <email@example.com> Reviewed-by: Paul E. McKenney <firstname.lastname@example.org> Signed-off-by: Andrew Morton <email@example.com> Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
Diffstat (limited to 'security/Kconfig')
1 files changed, 1 insertions, 0 deletions
diff --git a/security/Kconfig b/security/Kconfig
index beb86b500adf..bf4ec46474b6 100644
@@ -21,6 +21,7 @@ config SECURITY_DMESG_RESTRICT
bool "Enable different security models"
depends on SYSFS
+ depends on MULTIUSER
This allows you to choose different security modules to be
configured into your kernel.