]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: handle ATTR_KILL*
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 4 Jul 2016 14:49:48 +0000 (16:49 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 4 Jul 2016 14:49:48 +0000 (16:49 +0200)
commit65b5b3a87f5e251b8b602c6e517d3cea75befe7c
tree01c7236cc00eafd5a9f72481ef31c5e17d34783a
parent67cdf5a8c0d1e87063033bea9387a1c64c63e552
ovl: handle ATTR_KILL*

Before 16642b5d2b95 ("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: 16642b5d2b95 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Cc: <stable@vger.kernel.org>
fs/overlayfs/inode.c