android_kernel_samsung_msm8226/fs/gfs2
Jan Kara fb6e6f321a 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
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2019-08-06 12:23:27 +02:00
..
Kconfig GFS2: use depends instead of select in kconfig 2012-03-26 09:18:02 +01:00
Makefile
acl.c BACKPORT: posix_acl: Clear SGID bit when setting file permissions 2019-08-06 12:23:27 +02:00
acl.h
aops.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
bmap.c GFS2: Make sure rindex is uptodate before starting transactions 2012-04-05 10:20:10 +01:00
bmap.h
dentry.c
dir.c GFS2: Make sure rindex is uptodate before starting transactions 2012-04-05 10:20:10 +01:00
dir.h
export.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
file.c get rid of pointless includes of ext2_fs.h 2012-03-31 16:03:15 -04:00
gfs2.h
glock.c GFS2: glock statistics gathering 2012-02-28 17:09:42 +00:00
glock.h
glops.c
glops.h
incore.h GFS2: Eliminate sd_rindex_mutex 2012-03-05 15:06:56 +00:00
inode.c GFS2: Make sure rindex is uptodate before starting transactions 2012-04-05 10:20:10 +01:00
inode.h
lock_dlm.c GFS2: Instruct DLM to avoid queue convert slowdown 2012-04-24 13:26:50 +01:00
log.c GFS2: Clean up log flush header writing 2012-03-09 14:07:06 +00:00
log.h GFS2: Move two functions from log.c to lops.c 2012-02-28 17:09:59 +00:00
lops.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
lops.h
main.c GFS2: Remove a __GFP_NOFAIL allocation 2012-03-08 12:10:23 +00:00
meta_io.c
meta_io.h
ops_fstype.c fs: Limit sys_mount to only request filesystem modules. 2019-08-06 10:44:59 +02:00
quota.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw 2012-03-21 18:00:03 -07:00
quota.h
recovery.c
recovery.h
rgrp.c GFS2: Make sure rindex is uptodate before starting transactions 2012-04-05 10:20:10 +01:00
rgrp.h GFS2: FITRIM ioctl support 2012-02-28 17:10:21 +00:00
super.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
super.h
sys.c
sys.h
trace_gfs2.h GFS2: glock statistics gathering 2012-02-28 17:09:42 +00:00
trans.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
trans.h
util.c GFS2: Remove a __GFP_NOFAIL allocation 2012-03-08 12:10:23 +00:00
util.h GFS2: Remove a __GFP_NOFAIL allocation 2012-03-08 12:10:23 +00:00
xattr.c GFS2: Make sure rindex is uptodate before starting transactions 2012-04-05 10:20:10 +01:00
xattr.h