Files
linux/fs/nfsd
Ben Hutchings 3f84339bd3 nfsd: auth: Fix gid sorting when rootsquash enabled
commit 1995266727 upstream.

Commit bdcf0a423e ("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: bdcf0a423e ("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>
Cc: Wolfgang Walter <linux@stwm.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 12:06:14 +01:00
..
2014-07-08 17:14:27 -04:00
2017-06-14 13:16:24 +02:00
2014-08-17 12:00:12 -04:00
2015-02-05 14:35:18 +01:00
2015-04-21 16:16:02 -04:00
2015-02-16 11:43:13 -05:00
2017-03-12 06:37:30 +01:00
2015-02-02 18:09:43 +01:00