]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
UBUNTU: SAUCE: overlayfs: Be more careful about copying up sxid files
authorSeth Forshee <seth.forshee@canonical.com>
Thu, 21 Jan 2016 17:52:04 +0000 (11:52 -0600)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 25 Nov 2019 13:56:27 +0000 (14:56 +0100)
commit1d02155ff88a14a676f7887f531e55d348a5f793
tree413f7acf099c367bcb6f487f0e935d7a885024b9
parent74f5ea69d5c8d14cfdb15cabafaafd6bec1a2cd2
UBUNTU: SAUCE: overlayfs: Be more careful about copying up sxid files

When an overlayfs filesystem's lowerdir is on a nosuid filesystem
but the upperdir is not, it's possible to copy up an sxid file or
stick directory into upperdir without changing the mode by
opening the file rw in the overlayfs mount without writing to it.
This makes it possible to bypass the nosuid restriction on the
lowerdir mount.

It's a bad idea in general to let the mounter copy up a sxid file
if the mounter wouldn't have had permission to create the sxid
file in the first place. Therefore change ovl_set_xattr to
exclude these bits when initially setting the mode, then set the
full mode after setting the user for the inode. This allows copy
up for non-sxid files to work as before but causes copy up to
fail for the cases where the user could not have created the sxid
inode in upperdir.

BugLink: http://bugs.launchpad.net/bugs/1534961
BugLink: http://bugs.launchpad.net/bugs/1535150
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
fs/overlayfs/copy_up.c