Thiago Rafael Becker 58330ec2fe kernel: make groups_sort calling a responsibility group_info allocators
commit bdcf0a423ea1c40bbb40e7ee483b50fc8aa3d758 upstream.

In testing, we found that nfsd threads may call set_groups in parallel
for the same entry cached in auth.unix.gid, racing in the call of
groups_sort, corrupting the groups for that entry and leading to
permission denials for the client.

This patch:
 - Make groups_sort globally visible.
 - Move the call to groups_sort to the modifiers of group_info
 - Remove the call to groups_sort from set_groups

Link: http://lkml.kernel.org/r/20171211151420.18655-1-thiago.becker@gmail.com
Signed-off-by: Thiago Rafael Becker <thiago.becker@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: NeilBrown <neilb@suse.com>
Acked-by: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10 09:27:10 +01:00
..
2015-06-30 19:44:57 -07:00
2017-12-20 10:04:56 +01:00
2017-08-06 19:19:42 -07:00
2015-06-25 17:00:42 -07:00
2017-11-30 08:37:20 +00:00
2017-06-14 13:16:24 +02:00
2017-08-06 19:19:42 -07:00
2016-11-10 16:36:34 +01:00
2017-12-20 10:05:00 +01:00
2017-06-14 13:16:24 +02:00
2015-11-13 20:34:33 -05:00
2015-11-23 21:11:08 -05:00
2016-10-07 15:23:47 +02:00
2015-11-10 12:07:22 -08:00
2017-06-14 13:16:24 +02:00
2015-11-16 23:54:45 -08:00
2017-08-06 19:19:42 -07:00
2017-07-15 11:57:44 +02:00
2015-11-16 23:54:45 -08:00
2015-08-12 15:28:45 -05:00
2016-08-10 11:49:27 +02:00
2017-06-14 13:16:24 +02:00
2017-08-06 19:19:42 -07:00
2017-06-14 13:16:24 +02:00