linux/drivers/staging
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
..
android staging: android: ion_test: Add the MODULE_LICENSE macro 2015-04-03 15:13:52 +02:00
board
clocking-wizard
comedi staging: comedi: remove "comedi_fc.h" 2015-04-03 13:14:08 +02:00
dgap
dgnc staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err() 2015-04-01 17:37:57 +02:00
emxx_udc
fbtft
fsl-mc staging: fsl-mc: Changed version matching rules for MC object drivers 2015-04-03 13:55:03 +02:00
ft1000 staging: ft1000: Drop unneeded cast on netdev_priv 2015-04-03 14:00:14 +02:00
fwserial
gdm72xx
gdm724x
goldfish
gs_fpgaboot
i2o
iio Merge 4.0-rc7 into staging-next 2015-04-07 11:03:02 +02:00
lustre kernel: conditionally support non-root users, groups and capabilities 2015-04-15 16:35:22 -07:00
media
mt29f_spinand
netlogic
nvec Staging driver patches for 4.1-rc1 2015-04-13 17:37:33 -07:00
octeon staging: octeon-ethernet: delete cvm_oct_set_carrier() 2015-04-03 13:57:28 +02:00
octeon-usb staging: octeon-usb: make CVMX_WAIT_FOR_FIELD32 to take condition expression 2015-04-03 13:57:28 +02:00
olpc_dcon staging/olpc: drop pci dependencies 2015-04-03 13:56:03 +02:00
ozwpan
panel
rtl8188eu
rtl8192e staging: rtl8192e: Remove dead code 2015-04-03 15:29:31 +02:00
rtl8192u Staging: rtl8192u: use correct array for debug output 2015-04-03 15:40:49 +02:00
rtl8712 staging: rtl8712: Drop unneeded cast on netdev_priv 2015-04-03 15:15:40 +02:00
rtl8723au Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
rts5208
skein
slicoss
sm7xxfb staging: sm7xxfb: disable pci device 2015-04-03 13:55:03 +02:00
sm750fb Revert "Staging: sm750fb: Fix C99 Comments" 2015-04-04 12:00:25 +02:00
speakup staging: speakup: Fix warning of line over 80 characters. 2015-04-03 13:43:45 +02:00
ste_rmi4
unisys 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
vme
vt6655 staging: vt6655: use ieee80211_tx_info to select packet type. 2015-04-03 15:12:54 +02:00
vt6656
wlan-ng
xgifb
Kconfig
Makefile
staging.c