sunrpc: fix refcount leak for rpc auth modules
authorDaniel Kobras <kobras@puzzle-itc.de>
Fri, 26 Feb 2021 23:04:37 +0000 (00:04 +0100)
committerChuck Lever <chuck.lever@oracle.com>
Sat, 6 Mar 2021 21:41:49 +0000 (16:41 -0500)
commitf1442d6349a2e7bb7a6134791bdc26cb776c79af
tree30a600c0850e8a14bb5c038a3d5c3e8b217ff9d0
parentc7de87ff9dac5f396f62d584f3908f80ddc0e07b
sunrpc: fix refcount leak for rpc auth modules

If an auth module's accept op returns SVC_CLOSE, svc_process_common()
enters a call path that does not call svc_authorise() before leaving the
function, and thus leaks a reference on the auth module's refcount. Hence,
make sure calls to svc_authenticate() and svc_authorise() are paired for
all call paths, to make sure rpc auth modules can be unloaded.

Signed-off-by: Daniel Kobras <kobras@puzzle-itc.de>
Fixes: 4d712ef1db05 ("svcauth_gss: Close connection when dropping an incoming message")
Link: https://lore.kernel.org/linux-nfs/3F1B347F-B809-478F-A1E9-0BE98E22B0F0@oracle.com/T/#t
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/svc.c