Eric W. Biederman 6708075f10 userns: Don't let unprivileged users trick privileged users into setting the id_map
When we require privilege for setting /proc/<pid>/uid_map or
/proc/<pid>/gid_map no longer allow an unprivileged user to
open the file and pass it to a privileged program to write
to the file.

Instead when privilege is required require both the opener and the
writer to have the necessary capabilities.

I have tested this code and verified that setting /proc/<pid>/uid_map
fails when an unprivileged user opens the file and a privielged user
attempts to set the mapping, that unprivileged users can still map
their own id, and that a privileged users can still setup an arbitrary
mapping.

Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2013-04-14 18:11:14 -07:00
..
2013-03-02 08:31:39 -08:00
2013-04-12 06:33:56 +02:00
2013-02-21 12:05:51 -08:00
2012-05-31 17:49:27 -07:00
2012-03-28 18:30:03 +01:00
2012-12-20 17:40:19 -08:00
2012-05-29 23:28:41 -04:00
2013-01-24 15:37:26 +01:00
2013-02-08 17:47:13 +01:00
2013-02-22 23:31:31 -05:00