android_kernel_google_msm/fs/ext4
Jan Kara b1a8c88774 BACKPORT: posix_acl: Clear SGID bit when setting file permissions
[Partially applied during f2fs inclusion, changes now aligned to upstream]

(cherry pick from commit 073931017b49d9458aa351605b43a7e34598caef)

When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok().  Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't clear the setgid bit in
a similar way; this allows to bypass the check in chmod(2).  Fix that.

NB: conflicts resolution included extending the change to all visible
    users of the near deprecated function posix_acl_equiv_mode
    replaced with posix_acl_update_mode. We did not resolve the ACL
    leak in this CL, require additional upstream fixes.

References: CVE-2016-7097
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Bug: 32458736
[haggertk]: Backport to 3.4/msm8974
  * convert use of capable_wrt_inode_uidgid to capable
Change-Id: I19591ad452cc825ac282b3cfd2daaa72aa9a1ac1
2017-06-26 20:26:17 +03:00
..
acl.c BACKPORT: posix_acl: Clear SGID bit when setting file permissions 2017-06-26 20:26:17 +03:00
acl.h
balloc.c ext4: fix balloc.c printk-format-warning 2012-02-20 17:57:24 -05:00
bitmap.c
block_validity.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
dir.c Merge branch 'for-3.4' of git://linux-nfs.org/~bfields/linux 2012-03-29 14:53:25 -07:00
ext4.h ext4: address scalability issue by removing extent cache statistics 2012-04-16 12:16:20 -04:00
ext4_extents.h ext4: add no_printk argument validation, fix fallout 2012-03-19 23:11:43 -04:00
ext4_jbd2.c
ext4_jbd2.h ext4: expand commit callback and 2012-02-20 17:53:02 -05:00
extents.c Ext4 regression fixes for 3.4 2012-04-17 13:30:34 -07:00
file.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 2011-11-02 10:06:20 -07:00
fsync.c ext4: fix race between sync and completed io work 2012-03-05 10:29:52 -05:00
hash.c ext4: return 32/64-bit dir name hash according to usage type 2012-03-18 22:44:40 -04:00
ialloc.c ext4: fix unjournaled inode bitmap modification 2016-10-29 23:12:26 +08:00
indirect.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
inode.c fs: ext4: disable support for fallocate FALLOC_FL_PUNCH_HOLE 2016-10-31 23:29:10 +11:00
ioctl.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
Kconfig
Makefile
mballoc.c ext4: always set then trimmed blocks count into len 2012-03-21 21:26:22 -04:00
mballoc.h ext4: remove EXT4_MB_{BITMAP,BUDDY} macros 2012-02-20 17:54:06 -05:00
migrate.c ext4: using PTR_ERR() on the wrong variable in ext4_ext_migrate() 2012-02-20 17:53:06 -05:00
mmp.c ext4: Fix endianness bug when reading the MMP block 2012-02-27 01:09:03 -05:00
move_extent.c
namei.c ext4: avoid hang when mounting non-journal filesystems with orphan list 2016-10-29 23:12:34 +08:00
page-io.c Revert "ext4: don't release page refs in ext4_end_bio()" 2012-03-29 17:00:56 -07:00
resize.c ext4: update s_free_{inodes,blocks}_count during online resize 2012-03-20 15:46:11 -04:00
super.c ext4: validate s_first_meta_bg at mount time 2017-03-03 13:40:24 -07:00
symlink.c
truncate.h
xattr.c ext4: add no_printk argument validation, fix fallout 2012-03-19 23:11:43 -04:00
xattr.h
xattr_security.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
xattr_trusted.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
xattr_user.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00