linux/fs/overlayfs
Miklos Szeredi b82c78948a ovl: handle ATTR_KILL*
commit b99c2d9138 upstream.

Before 4bacc9c923 ("overlayfs: Make f_path...") file->f_path pointed to
the underlying file, hence suid/sgid removal on write worked fine.

After that patch file->f_path pointed to the overlay file, and the file
mode bits weren't copied to overlay_inode->i_mode.  So the suid/sgid
removal simply stopped working.

The fix is to copy the mode bits, but then ovl_setattr() needs to clear
ATTR_MODE to avoid the BUG() in notify_change().  So do this first, then in
the next patch copy the mode.

Reported-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 4bacc9c923 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Cc: Eric Schultz <eric@startuperic.com>
Cc: Eric Hameleers <alien@slackware.com>
[backported by Eric Hameleers as seen in https://bugzilla.kernel.org/show_bug.cgi?id=150711]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2016-08-10 11:49:28 +02:00
..
copy_up.c ovl: use a minimal buffer in ovl_copy_xattr 2016-02-25 12:01:24 -08:00
dir.c ovl: verify upper dentry before unlink and rename 2016-07-27 09:47:40 -07:00
inode.c ovl: handle ATTR_KILL* 2016-08-10 11:49:28 +02:00
Kconfig ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
Makefile ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
overlayfs.h ovl: Copy up underlying inode's ->i_mode to overlay inode 2016-07-27 09:47:39 -07:00
readdir.c ovl: check dentry positiveness in ovl_cleanup_whiteouts() 2016-02-25 12:01:24 -08:00
super.c fs: add file_dentry() 2016-04-20 15:42:12 +09:00