sunrpc: only free unix grouplist after RCU settles
authorJeff Layton <jlayton@kernel.org>
Thu, 30 Mar 2023 18:24:27 +0000 (14:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Apr 2023 14:55:23 +0000 (16:55 +0200)
commit94ef35dd2ea14f661865220a305d21961c9e8c92
treeec49605ae6bfd2db5dd8b59ad12dc05039a92e49
parent710392fd6546d3e90b79fa2d7fce2baec2503c64
sunrpc: only free unix grouplist after RCU settles

[ Upstream commit 5085e41f9e83a1bec51da1f20b54f2ec3a13a3fe ]

While the unix_gid object is rcu-freed, the group_info list that it
contains is not. Ensure that we only put the group list reference once
we are really freeing the unix_gid object.

Reported-by: Zhi Li <yieli@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2183056
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Fixes: fd5d2f78261b ("SUNRPC: Make server side AUTH_UNIX use lockless lookups")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/svcauth_unix.c