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
..
2015-02-19 13:31:40 +03:00
2014-12-14 14:57:16 -08:00
2015-03-29 16:17:10 +01:00
2014-11-24 17:24:08 -05:00
2015-04-02 16:25:04 -04:00
2015-02-18 08:01:44 -08:00
2015-02-11 10:28:45 -08:00
2015-01-29 10:49:28 +02:00
2015-04-07 11:17:34 +02:00
2015-03-25 20:28:11 -04:00
2015-03-11 15:56:59 -07:00
2015-02-12 18:54:15 -08:00
2014-12-19 22:55:06 +01:00
2015-01-21 19:21:30 +01:00
2014-11-10 09:27:30 -07:00
2015-03-02 16:43:41 -05:00
2014-12-31 13:06:50 -05:00
2014-10-09 11:35:48 +03:00
2014-10-08 16:01:41 -04:00
2015-01-25 23:17:28 -05:00
2015-02-18 15:08:33 +01:00
2015-01-27 11:09:13 +01:00
2014-09-29 15:37:01 -04:00
2014-12-16 14:53:01 -08:00
2015-04-11 11:17:28 +02:00
2015-01-15 10:34:54 +01:00
2015-01-15 10:34:54 +01:00
2015-02-13 21:21:36 -08:00
2015-02-17 14:34:51 -08:00
2015-01-24 10:11:12 +01:00
2014-12-18 09:39:51 +01:00
2015-01-04 23:11:43 -05:00
2015-04-14 16:49:05 -07:00
2014-10-09 22:25:58 -04:00
2014-10-24 00:14:36 +02:00
2015-03-11 17:56:28 -04:00
2014-11-04 13:29:38 +00:00
2015-04-10 08:27:18 -05:00
2015-01-25 23:17:28 -05:00
2015-02-17 14:34:52 -08:00
2015-01-06 11:01:13 -08:00
2015-02-24 08:44:16 +01:00
2015-02-13 21:21:41 -08:00
2015-01-22 15:10:56 +01:00
2015-03-11 21:55:28 -04:00
2015-04-11 15:53:35 -04:00
2015-01-03 14:32:57 -05:00
2015-02-13 21:21:35 -08:00
2015-03-25 13:28:58 +01:00
2015-04-11 22:26:51 -04:00
2014-11-28 16:08:16 +01:00
2015-04-14 18:06:47 -07:00
2014-12-09 12:05:24 +02:00
2014-12-15 23:49:28 +02:00
2015-04-15 16:35:20 -07:00