]> git.baikalelectronics.ru Git - kernel.git/commit
sunrpc: expiry_time should be seconds not timeval
authorRoberto Bergantinos Corpas <rbergant@redhat.com>
Tue, 4 Feb 2020 10:32:56 +0000 (11:32 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 7 Feb 2020 18:30:41 +0000 (13:30 -0500)
commit1a197605a334a945723ec13f0d7cfad439cd43db
treeec349b6ac0eb08b6d1d00e54775b285e8c92df1a
parenta288785bc29fd665edb120f054b0c8aa6a814f03
sunrpc: expiry_time should be seconds not timeval

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 e7a3b7488263 "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: c543a949569b "SUNRPC: Use gssproxy upcall for server..."
Tested-By: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/auth_gss/svcauth_gss.c