android_kernel_oneplus_msm8998/fs/ext2
Jan Kara 8e8224de0e ext2: Don't clear SGID when inheriting ACLs
commit a992f2d38e4ce17b8c7d1f7f67b2de0eebdea069 upstream.

When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
set, DIR1 is expected to have SGID bit set (and owning group equal to
the owning group of 'DIR0'). However when 'DIR0' also has some default
ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
'DIR1' to get cleared if user is not member of the owning group.

Fix the problem by creating __ext2_set_acl() function that does not call
posix_acl_update_mode() and use it when inheriting ACLs. That prevents
SGID bit clearing and the mode has been properly set by
posix_acl_create() anyway.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
CC: stable@vger.kernel.org
CC: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 12:06:11 +01:00
..
acl.c ext2: Don't clear SGID when inheriting ACLs 2018-01-31 12:06:11 +01:00
acl.h ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
balloc.c
dir.c pagemap.h: move dir_pages() over there 2015-06-23 18:02:00 -04:00
ext2.h ext2: Add locking for DAX faults 2015-10-19 14:40:54 +02:00
file.c ext2: Add locking for DAX faults 2015-10-19 14:40:54 +02:00
ialloc.c ext2: Handle error from dquot_initalize() 2015-07-23 20:59:37 +02:00
inode.c ext2: Add locking for DAX faults 2015-10-19 14:40:54 +02:00
ioctl.c
Kconfig vfs,ext2: remove CONFIG_EXT2_FS_XIP and rename CONFIG_FS_XIP to CONFIG_FS_DAX 2015-02-16 17:56:04 -08:00
Makefile ext2: remove xip.c and xip.h 2015-02-16 17:56:03 -08:00
namei.c fs/ext2/namei.c: remove unnecessary new_valid_dev() check 2015-11-09 15:11:24 -08:00
super.c ext2, ext4: warn when mounting with dax enabled 2015-11-16 09:43:54 -08:00
symlink.c ext2: use simple_follow_link() 2015-05-10 22:18:21 -04:00
xattr.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00
xattr.h ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
xattr_security.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00
xattr_trusted.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00
xattr_user.c xattr handlers: Pass handler to operations instead of flags 2015-11-13 20:34:32 -05:00