android_kernel_samsung_msm8976/fs
Ben Hutchings d8bfd2f23b nfsd: auth: Fix gid sorting when rootsquash enabled
commit 1995266727fa8143897e89b55f5d3c79aa828420 upstream.

Commit bdcf0a423ea1 ("kernel: make groups_sort calling a responsibility
group_info allocators") appears to break nfsd rootsquash in a pretty
major way.

It adds a call to groups_sort() inside the loop that copies/squashes
gids, which means the valid gids are sorted along with the following
garbage.  The net result is that the highest numbered valid gids are
replaced with any lower-valued garbage gids, possibly including 0.

We should sort only once, after filling in all the gids.

Fixes: bdcf0a423ea1 ("kernel: make groups_sort calling a responsibility ...")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Acked-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:46:18 +02:00
..
9p
adfs
affs
afs
autofs4
befs
bfs
btrfs
cachefiles
ceph
cifs
coda
configfs
cramfs
crypto
debugfs
devpts
dlm
ecryptfs fs: ecryptfs: Checkout to LA.BR.1.3.6-04510-8976.0 2018-02-06 13:12:17 +01:00
efivarfs
efs
exfat
exofs
exportfs
ext2 it's still short a few helpers, but infrastructure should be OK now... 2018-12-03 11:52:03 +01:00
ext3 posix_acl: Clear SGID bit when setting file permissions 2019-07-27 21:42:52 +02:00
ext4 ext4: fix crash when a directory's i_size is too small 2019-07-27 21:46:17 +02:00
f2fs
fat fat: fix using uninitialized fields of fat_inode/fsinfo_inode 2019-07-27 21:43:58 +02:00
freevxfs
fscache FS-Cache: fix dereference of NULL user_key_payload 2019-07-27 21:44:20 +02:00
fuse fuse: initialize the flock flag in fuse_file on allocation 2019-07-27 21:44:16 +02:00
gfs2 posix_acl: Clear SGID bit when setting file permissions 2019-07-27 21:42:52 +02:00
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs isofs: fix timestamps beyond 2027 2019-07-27 21:46:04 +02:00
jbd
jbd2
jffs2
jfs posix_acl: Clear SGID bit when setting file permissions 2019-07-27 21:42:52 +02:00
lockd
logfs
minix it's still short a few helpers, but infrastructure should be OK now... 2018-12-03 11:52:03 +01:00
ncpfs
nfs
nfs_common
nfsd nfsd: auth: Fix gid sorting when rootsquash enabled 2019-07-27 21:46:18 +02:00
nilfs2
nls
notify vfs: Add permission2 for filesystems with per mount permissions 2018-02-06 13:12:19 +01:00
ntfs
ocfs2 posix_acl: Clear SGID bit when setting file permissions 2019-07-27 21:42:52 +02:00
omfs
openpromfs
proc UPSTREAM: capabilities: ambient capabilities 2018-02-06 13:12:16 +01:00
pstore pstore/ram: Use memcpy_fromio() to save old buffer 2019-07-27 21:42:50 +02:00
qnx4
qnx6
quota
ramfs
reiserfs
romfs
sdcardfs ANDROID: sdcardfs: Protect set_top 2018-08-15 14:40:15 +02:00
sdfat Import T813XXS2BRC2 kernel source changes 2018-05-26 00:39:42 +02:00
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs posix_acl: Clear SGID bit when setting file permissions 2019-07-27 21:42:52 +02:00
yaffs2
aio.c
anon_inodes.c
attr.c vfs: Add setattr2 for filesystems with per mount permissions 2018-02-06 13:12:20 +01:00
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c more bio_map_user_iov() leak fixes 2019-07-27 21:45:37 +02:00
block_dev.c block: protect iterate_bdevs() against concurrent close 2019-07-27 21:42:54 +02:00
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
coredump.c coredump: fix unfreezable coredumping task 2019-07-27 21:42:15 +02:00
coredump.h
dcache.c fs: take_dentry_name_snapshot: avoid kfree under spinlock fixup 2019-07-27 21:45:27 +02:00
dcookies.c
direct-io.c direct-io: Prevent NULL pointer access in submit_page_section 2019-07-27 21:44:19 +02:00
drop_caches.c
eventfd.c
eventpoll.c epoll: fix race between ep_poll_callback(POLLFREE) and ep_free()/ep_remove() 2019-07-27 21:45:14 +02:00
exec.c fs: exec: apply CLOEXEC before changing dumpable task flags 2019-07-27 21:43:25 +02:00
fcntl.c vfs: add missing check for __O_TMPFILE in fcntl_init() 2018-12-03 11:52:41 +01:00
fhandle.c
file.c
file_table.c
filesystems.c
fs-writeback.c
fs_struct.c sdcardfs: override umask on mkdir and create 2018-02-06 13:12:18 +01:00
generic_acl.c
inode.c allow the temp files created by open() to be linked to 2018-12-03 11:52:08 +01:00
internal.h vfs: Allow filesystems to access their private mount data 2018-02-06 13:12:19 +01:00
ioctl.c
ioprio.c
Kconfig Initial port of sdcardfs 2018-02-06 13:12:17 +01:00
Kconfig.binfmt
libfs.c
locks.c
Makefile Initial port of sdcardfs 2018-02-06 13:12:17 +01:00
mbcache.c
mount.h
mpage.c
namei.c VFS: Properly free dentry name snapshots in vfs_rename2 2019-07-27 21:46:08 +02:00
namespace.c vfs: Allow filesystems to access their private mount data 2018-02-06 13:12:19 +01:00
no-block.c
open.c fs: Fix file mode for O_TMPFILE 2018-12-03 11:52:40 +01:00
pipe.c
pnode.c ANDROID: mnt: remount should propagate to slaves of slaves 2018-02-06 13:12:20 +01:00
pnode.h ANDROID: mnt: remount should propagate to slaves of slaves 2018-02-06 13:12:20 +01:00
posix_acl.c posix_acl: Clear SGID bit when setting file permissions 2019-07-27 21:42:52 +02:00
proc_namespace.c vfs: Allow filesystems to access their private mount data 2018-02-06 13:12:19 +01:00
read_write.c
readdir.c
select.c
seq_file.c fs/seq_file: fix out-of-bounds read 2019-07-27 21:42:21 +02:00
signalfd.c
splice.c vfs: fix uninitialized flags in splice_to_pipe() 2019-07-27 21:43:53 +02:00
stack.c
stat.c
statfs.c
super.c vfs: Allow filesystems to access their private mount data 2018-02-06 13:12:19 +01:00
sync.c Import T813XXS2BRC2 kernel source changes 2018-05-26 00:39:42 +02:00
timerfd.c
utimes.c vfs: Add setattr2 for filesystems with per mount permissions 2018-02-06 13:12:20 +01:00
xattr.c ANDROID: xattr: Pass EOPNOTSUPP to permission2 2018-08-15 14:40:12 +02:00
xattr_acl.c