]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
kernel: make groups_sort calling a responsibility group_info allocators
authorThiago Rafael Becker <thiago.becker@gmail.com>
Thu, 14 Dec 2017 23:33:12 +0000 (15:33 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 13 Mar 2018 10:47:08 +0000 (11:47 +0100)
commit1a4e3423f824f19ee34dd426b2244eee16b96a00
tree26f65665203d0a49676fe301ed3ec15613fc5d5b
parent639697bfb9eed305cca38937759eba3b60d66f35
kernel: make groups_sort calling a responsibility group_info allocators

BugLink: http://bugs.launchpad.net/bugs/1745263
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>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/s390/kernel/compat_linux.c
fs/nfsd/auth.c
include/linux/cred.h
kernel/groups.c
kernel/uid16.c
net/sunrpc/auth_gss/gss_rpc_xdr.c
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/svcauth_unix.c