svcrpc: don't leak contexts on PROC_DESTROY
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 9 Jan 2017 22:15:18 +0000 (17:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jan 2017 07:23:47 +0000 (08:23 +0100)
commit6f3002c22087b068fa656650f9c1319626e8f84c
tree5b0209760432991b54c5a1101f3c9895e246e68d
parent3b434ca8592a1ef2a7f5f31920641089a9e9f47b
svcrpc: don't leak contexts on PROC_DESTROY

commit 78794d1890708cf94e3961261e52dcec2cc34722 upstream.

Context expiry times are in units of seconds since boot, not unix time.

The use of get_seconds() here therefore sets the expiry time decades in
the future.  This prevents timely freeing of contexts destroyed by
client RPC_GSS_PROC_DESTROY requests.  We'd still free them eventually
(when the module is unloaded or the container shut down), but a lot of
contexts could pile up before then.

Fixes: c5b29f885afe "sunrpc: use seconds since boot in expiry cache"
Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/auth_gss/svcauth_gss.c