]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: SAUCE: capabilities: Allow privileged user in s_user_ns to set security....
authorSeth Forshee <seth.forshee@canonical.com>
Thu, 11 Dec 2014 22:05:15 +0000 (16:05 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:19:06 +0000 (10:19 +0100)
commite1804ed91602bc8ead616c9616de70096b139fa7
tree8d626275fddb6b9090a6cb4b5fe067a615a836c3
parent05b459a059d194d75e158c6846f8eb73e4a47db6
UBUNTU: SAUCE: capabilities: Allow privileged user in s_user_ns to set security.* xattrs

A privileged user in s_user_ns will generally have the ability to
manipulate the backing store and insert security.* xattrs into
the filesystem directly. Therefore the kernel must be prepared to
handle these xattrs from unprivileged mounts, and it makes little
sense for commoncap to prevent writing these xattrs to the
filesystem. The capability and LSM code have already been updated
to appropriately handle xattrs from unprivileged mounts, so it
is safe to loosen this restriction on setting xattrs.

The exception to this logic is that writing xattrs to a mounted
filesystem may also cause the LSM inode_post_setxattr or
inode_setsecurity callbacks to be invoked. SELinux will deny the
xattr update by virtue of applying mountpoint labeling to
unprivileged userns mounts, and Smack will deny the writes for
any user without global CAP_MAC_ADMIN, so loosening the
capability check in commoncap is safe in this respect as well.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
security/commoncap.c