android_kernel_samsung_msm8226/fs/btrfs
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
Makefile
acl.c BACKPORT: posix_acl: Clear SGID bit when setting file permissions 2019-08-06 12:23:27 +02:00
async-thread.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
async-thread.h
backref.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
backref.h
btrfs_inode.h
check-integrity.c
check-integrity.h
compat.h
compression.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
compression.h
ctree.c
ctree.h
delayed-inode.c
delayed-inode.h
delayed-ref.c
delayed-ref.h
dir-item.c
disk-io.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
disk-io.h
export.c
export.h
extent-tree.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
extent_io.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
extent_io.h Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
extent_map.c
extent_map.h
file-item.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
file.c
free-space-cache.c
free-space-cache.h
hash.h
inode-item.c
inode-map.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
inode-map.h
inode.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
ioctl.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
ioctl.h
locking.c
locking.h
lzo.c
ordered-data.c
ordered-data.h
orphan.c
print-tree.c
print-tree.h
reada.c
relocation.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
root-tree.c
scrub.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
struct-funcs.c
super.c fs: Limit sys_mount to only request filesystem modules. 2019-08-06 10:44:59 +02:00
sysfs.c
transaction.c
transaction.h
tree-defrag.c
tree-log.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
tree-log.h
ulist.c
ulist.h
version.h
volumes.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
volumes.h
xattr.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
xattr.h
zlib.c