linux-stable/net/sunrpc
Roberto Bergantinos Corpas 4274984b78 sunrpc: expiry_time should be seconds not timeval
commit 3d96208c30 upstream.

When upcalling gssproxy, cache_head.expiry_time is set as a
timeval, not seconds since boot. As such, RPC cache expiry
logic will not clean expired objects created under
auth.rpcsec.context cache.

This has proven to cause kernel memory leaks on field. Using
64 bit variants of getboottime/timespec

Expiration times have worked this way since 2010's c5b29f885a "sunrpc:
use seconds since boot in expiry cache".  The gssproxy code introduced
in 2012 added gss_proxy_save_rsc and introduced the bug.  That's a while
for this to lurk, but it required a bit of an extreme case to make it
obvious.

Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 030d794bf4 "SUNRPC: Use gssproxy upcall for server..."
Tested-By: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:32:15 -05:00
..
auth_gss sunrpc: expiry_time should be seconds not timeval 2020-02-14 16:32:15 -05:00
xprtrdma xprtrdma: Fix completion wait during device removal 2020-01-17 19:45:47 +01:00
addr.c
auth.c
auth_generic.c SUNRPC: Fix a bogus get/put in generic_key_to_expire() 2018-12-01 09:42:54 +01:00
auth_null.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
auth_unix.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
backchannel_rqst.c SUNRPC: Don't hold the transport lock when receiving backchannel data 2017-08-16 15:10:16 -04:00
cache.c sunrpc: fix crash when cache_head become valid before update 2019-12-17 20:40:00 +01:00
clnt.c net :sunrpc :clnt :Fix xps refcount imbalance on the error path 2019-07-21 09:04:29 +02:00
debugfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
netns.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rpc_pipe.c rpc_pipefs: fix double-dput() 2018-04-24 09:36:38 +02:00
rpcb_clnt.c sunrpc: handle ENOMEM in rpcb_getport_async 2019-01-23 08:09:50 +01:00
sched.c SUNRPC: Fix priority queue fairness 2019-11-24 08:22:52 +01:00
socklib.c
stats.c sunrpc: move pc_count out of struct svc_procinfo 2017-07-13 15:58:02 -04:00
sunrpc.h
sunrpc_syms.c
svc.c sunrpc: use-after-free in svc_process_common() 2019-01-16 22:07:13 +01:00
svc_xprt.c sunrpc: use-after-free in svc_process_common() 2019-01-16 22:07:13 +01:00
svcauth.c
svcauth_unix.c kernel: make groups_sort calling a responsibility group_info allocators 2017-12-20 10:10:18 +01:00
svcsock.c sunrpc: use-after-free in svc_process_common() 2019-01-16 22:07:13 +01:00
sysctl.c
timer.c
xdr.c SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer() 2018-11-27 16:10:49 +01:00
xprt.c sunrpc: Fix connect metrics 2019-11-24 08:22:59 +01:00
xprtmultipath.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xprtsock.c sunrpc: safely reallow resvport min/max inversion 2019-12-01 09:13:42 +01:00