android_kernel_samsung_msm8226/fs/9p
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
acl.h switch posix_acl_create() to umode_t * 2011-08-01 02:09:42 -04:00
cache.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
cache.h fs/9p: When doing inode lookup compare qid details and inode mode bits. 2011-07-23 09:32:48 -05:00
fid.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
fid.h
v9fs.c 9p: make register_filesystem() the last failure exit 2012-03-20 21:29:45 -04:00
v9fs.h fs/9p: Always ask new inode in create 2011-07-23 09:32:50 -05:00
v9fs_vfs.h 9p: propagate umode_t 2012-01-03 22:55:01 -05:00
vfs_addr.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
vfs_dentry.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
vfs_dir.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
vfs_file.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
vfs_inode.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
vfs_inode_dotl.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
vfs_super.c fs: Limit sys_mount to only request filesystem modules. 2019-08-06 10:44:59 +02:00
xattr.c 9p: Reduce object size with CONFIG_NET_9P_DEBUG 2012-01-05 10:51:44 -06:00
xattr.h
xattr_user.c