Christian Brauner 91d4ab622b
libmisc: retain setfcap when mapping uid 0
When uid 0 maps host uid 0 into the child userns newer kernels require
CAP_SETFCAP be retained as this allows the caller to create fscaps that
are valid in the ancestor userns. This was a security issue (in very
rare circumstances). So whenever host uid 0 is mapped, retain
CAP_SETFCAP if the caller had it.
Userspace won't need to set CAP_SETFCAP on newuidmap as this is really
only a scenario that real root should be doing which always has
CAP_SETFCAP. And if they don't then they are in a locked-down userns.
(LXC sometimes maps host uid 0 during chown operations in a helper
 userns but will not rely on newuidmap for that. But we don't want to
 risk regressing callers that want to rely on this behavior.)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-06 19:04:42 +02:00
..
2011-09-18 21:02:43 +00:00
2020-01-12 07:31:26 -06:00
2017-10-22 18:33:13 +00:00
2019-10-12 20:03:32 -05:00
2019-10-12 20:03:32 -05:00
2017-10-22 19:17:02 +00:00
2021-04-16 21:02:37 -05:00
2021-02-01 22:11:10 +01:00
2021-02-01 22:11:10 +01:00
2017-10-22 19:08:39 +00:00
2017-10-22 18:33:13 +00:00
2013-08-04 15:56:32 +02:00
2018-06-24 00:13:12 -05:00
2011-11-06 18:40:06 +00:00