linux/arch
Iulia Manda 2813893f8b 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)

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-15 16:35:22 -07:00
..
alpha alpha: expose number of page table levels on Kconfig level 2015-04-14 16:49:01 -07:00
arc Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-14 15:31:03 -07:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
arm64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
avr32 avr32: fix integer overflow in ELF_ET_DYN_BASE 2015-04-13 18:48:55 +02:00
blackfin blackfin: Use common outgoing-CPU-notification code 2015-03-11 13:22:36 -07:00
c6x whack-a-mole: no need to set_fs(USER_DS) in {start,flush}_thread() 2015-04-11 22:24:31 -04:00
cris CRIS changes for 3.20 2015-02-15 18:02:02 -08:00
frv Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-14 15:31:03 -07:00
hexagon whack-a-mole: no need to set_fs(USER_DS) in {start,flush}_thread() 2015-04-11 22:24:31 -04:00
ia64 ia64: expose number of page table levels on Kconfig level 2015-04-14 16:49:02 -07:00
m32r whack-a-mole: there's no point doing set_fs(USER_DS) in sigframe setup 2015-04-11 22:24:31 -04:00
m68k m68k: mark PMD folded and expose number of page table levels 2015-04-14 16:49:02 -07:00
metag Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-14 15:31:03 -07:00
microblaze Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-14 15:31:03 -07:00
mips mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE 2015-04-14 16:49:05 -07:00
mn10300 Merge branches 'pci/enumeration' and 'pci/virtualization' into next 2015-03-23 17:17:34 -05:00
nios2 Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-14 15:31:03 -07:00
openrisc whack-a-mole: no need to set_fs(USER_DS) in {start,flush}_thread() 2015-04-11 22:24:31 -04:00
parisc parisc: expose number of page table levels on Kconfig level 2015-04-14 16:49:02 -07:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
s390 kernel: conditionally support non-root users, groups and capabilities 2015-04-15 16:35:22 -07:00
score all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
sh Merge branch 'akpm' (patches from Andrew) 2015-04-14 16:49:17 -07:00
sparc sparc: clarify __GFP_NOFAIL allocation 2015-04-14 16:49:04 -07:00
tile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
um um: expose number of page table levels 2015-04-14 16:49:02 -07:00
unicore32 PCI: Assign resources before drivers claim devices (pci_scan_bus()) 2015-03-12 15:04:01 -05:00
x86 Power management and ACPI updates for v4.1-rc1 2015-04-14 20:21:54 -07:00
xtensa Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-14 15:31:03 -07:00
.gitignore
Kconfig mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE 2015-04-14 16:49:05 -07:00