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 nfsd: add new reply_cache_stats file in nfsdfs 2013-04-03 11:47:24 -04:00
current_stateid.h
export.c nfsd: return better errors to exportfs 2013-11-29 11:11:49 -08:00
fault_inject.c Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
idmap.h
lockd.c
netns.h nfsd4: make del_recall_lru per-network-namespace 2013-04-04 13:25:16 -04:00
nfs2acl.c nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
nfs3acl.c
nfs3proc.c switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
nfs3xdr.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
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 Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
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 fs/nfsd: change type of max_delegations, nfsd_drc_max_mem and nfsd_drc_mem_used 2013-02-23 17:50:22 -08:00
nfsfh.c
nfsfh.h
nfsproc.c switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
nfssvc.c NFSD: Decrease nfsd_users in nfsd_startup_generic fail 2014-09-05 16:28:37 -07:00
nfsxdr.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
state.h nfsd4: implement SEQ4_STATUS_RECALLABLE_STATE_REVOKED 2013-04-16 10:59:30 -04:00
stats.c
vfs.c constify ->actor 2015-09-16 18:20:09 +05:30
vfs.h switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
xdr.h nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
xdr3.h nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
xdr4.h nfsd4: cleanup handling of nfsv4.0 closed stateid's 2013-04-08 09:55:32 -04:00
xdr4cb.h nfsd4: check backchannel attributes on create_session 2013-04-09 16:53:56 -04:00