android_kernel_samsung_msm8976/fs/ext2
Jan Kara 1f26976892 posix_acl: Clear SGID bit when setting file permissions
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.

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>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git
Git-commit: 073931017b49d9458aa351605b43a7e34598caef
Change-Id: Idf7cd8d0fb030fedeabd46254e4c4a9c08bce8b5
[d-cagle@codeaurora.org: Resolve merge conflicts and style]
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
[stummala@codeaurora.org: Resolve merge conflicts on existing files and
skip files fs/ceph/acl.c, fs/hfsplus/posix_acl.c and fs/jfs/acl.c from
original change as those files are not present/fix is not applicable on
3.10 kernel]
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2017-04-28 00:00:11 -07:00
..
Kconfig
Makefile switch ext2 to simple_fsync() 2009-06-11 21:36:12 -04:00
acl.c posix_acl: Clear SGID bit when setting file permissions 2017-04-28 00:00:11 -07:00
acl.h ext2: remove duplicate 'ext2_get_acl()' define 2011-07-29 23:21:50 -07:00
balloc.c Ext2: remove the static function release_blocks to optimize the kernel 2013-02-07 16:44:56 +01:00
dir.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ext2.h userns: Convert ext2 to use kuid/kgid where appropriate. 2012-05-15 14:59:26 -07:00
file.c fs: take the ACL checks to common code 2011-07-25 14:30:23 -04:00
ialloc.c ext2: Fix BUG_ON in evict() on inode deletion 2013-03-13 15:23:44 +01:00
inode.c ext2: Fix fs corruption in ext2_get_xip_mem() 2014-10-05 14:54:15 -07:00
ioctl.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
namei.c don't expose I_NEW inodes via dentry->d_inode 2012-07-23 00:00:58 +04:00
super.c fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
symlink.c ext2: symlink must be handled via filesystem specific operation 2010-04-12 21:11:25 +02:00
xattr.c Ext2: return ENOMEM rather than EIO if sb_getblk fails 2013-01-21 11:19:57 +01:00
xattr.h fs/vfs/security: pass last path component to LSM on inode creation 2011-02-01 11:12:29 -05:00
xattr_security.c migrate ext2_fs.h guts to fs/ext2/ext2.h 2012-03-31 16:03:16 -04:00
xattr_trusted.c migrate ext2_fs.h guts to fs/ext2/ext2.h 2012-03-31 16:03:16 -04:00
xattr_user.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
xip.c ext2: Fix fs corruption in ext2_get_xip_mem() 2014-10-05 14:54:15 -07:00
xip.h