android_kernel_samsung_msm8226/fs/ocfs2
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
..
cluster switch debugfs to umode_t 2012-01-03 22:54:56 -05:00
dlm Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
dlmfs fs: Limit sys_mount to only request filesystem modules. 2019-08-06 10:44:59 +02:00
Kconfig
Makefile
acl.c BACKPORT: posix_acl: Clear SGID bit when setting file permissions 2019-08-06 12:23:27 +02:00
acl.h
alloc.c ocfs2: ->l_next_free_req breakage on big-endian 2012-04-13 12:31:37 -04:00
alloc.h
aops.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
aops.h
blockcheck.c
blockcheck.h
buffer_head_io.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
buffer_head_io.h
dcache.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
dcache.h
dir.c
dir.h
dlmglue.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
dlmglue.h
export.c
export.h
extent_map.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
extent_map.h
file.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
file.h
heartbeat.c
heartbeat.h
inode.c
inode.h
ioctl.c get rid of pointless includes of ext2_fs.h 2012-03-31 16:03:15 -04:00
ioctl.h
journal.c
journal.h
localalloc.c
localalloc.h
locks.c
locks.h
mmap.c
mmap.h
move_extents.c vfs: mnt_drop_write_file() 2012-01-03 22:52:40 -05:00
move_extents.h
namei.c ocfs2: deal with wraparounds of i_nlink in ocfs2_rename() 2012-02-13 20:45:39 -05:00
namei.h
ocfs1_fs_compat.h
ocfs2.h
ocfs2_fs.h
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h
quota.h
quota_global.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
quota_local.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
refcounttree.c ocfs2: ->rl_count endianness breakage 2012-04-13 12:31:41 -04:00
refcounttree.h
reservations.c
reservations.h
resize.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
resize.h
slot_map.c
slot_map.h
stack_o2cb.c
stack_user.c dlm: add recovery callbacks 2012-01-04 08:56:31 -06:00
stackglue.c
stackglue.h
suballoc.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
suballoc.h Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
super.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
super.h
symlink.c
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
ver.c
ver.h
xattr.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
xattr.h ocfs2: propagate umode_t 2012-01-03 22:55:02 -05:00