android_kernel_samsung_msm8976/fs/nfsd
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
..
Kconfig
Makefile
acl.h
auth.c nfsd: auth: Fix gid sorting when rootsquash enabled 2019-07-27 21:46:18 +02:00
auth.h
cache.h
current_stateid.h
export.c nfsd: return better errors to exportfs 2013-11-29 11:11:49 -08:00
fault_inject.c
idmap.h
lockd.c
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c
nfs4acl.c NFSD: Call ->set_acl with a NULL ACL structure if no entries 2014-06-07 13:25:36 -07:00
nfs4callback.c nfsd: Fix slot wake up race in the nfsv4.1 callback code 2014-12-06 15:05:49 -08:00
nfs4idmap.c
nfs4proc.c nfsd4: fix crash on unknown operation number 2014-11-14 08:48:00 -08:00
nfs4recover.c constify ->actor 2015-09-16 18:20:09 +05:30
nfs4state.c fs: nfsd: Fix signedness bug in compare_blob 2015-01-16 06:59:02 -08:00
nfs4xdr.c nfsd4: fix xdr4 inclusion of escaped char 2015-01-16 06:59:02 -08:00
nfscache.c nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry 2014-07-06 18:54:14 -07:00
nfsctl.c nfsd: check passed socket's net matches NFSd superblock's one 2014-05-06 07:55:29 -07:00
nfsd.h
nfsfh.c
nfsfh.h
nfsproc.c
nfssvc.c NFSD: Decrease nfsd_users in nfsd_startup_generic fail 2014-09-05 16:28:37 -07:00
nfsxdr.c
state.h
stats.c
vfs.c constify ->actor 2015-09-16 18:20:09 +05:30
vfs.h
xdr.h
xdr3.h
xdr4.h
xdr4cb.h