linux/net/sunrpc/auth_gss
NeilBrown cf64b9bce9 SUNRPC: return proper error from get_expiry()
The get_expiry() function currently returns a timestamp, and uses the
special return value of 0 to indicate an error.

Unfortunately this causes a problem when 0 is the correct return value.

On a system with no RTC it is possible that the boot time will be seen
to be "3".  When exportfs probes to see if a particular filesystem
supports NFS export it tries to cache information with an expiry time of
"3".  The intention is for this to be "long in the past".  Even with no
RTC it will not be far in the future (at most a second or two) so this
is harmless.
But if the boot time happens to have been calculated to be "3", then
get_expiry will fail incorrectly as it converts the number to "seconds
since bootime" - 0.

To avoid this problem we change get_expiry() to report the error quite
separately from the expiry time.  The error is now the return value.
The expiry time is reported through a by-reference parameter.

Reported-by: Jerry Zhang <jerry@skydio.com>
Tested-by: Jerry Zhang <jerry@skydio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2023-04-26 09:05:00 -04:00
..
auth_gss_internal.h SUNRPC/auth_gss: Convert GFP_NOFS to GFP_KERNEL 2022-02-25 18:50:12 -05:00
auth_gss.c SUNRPC: Move remaining internal definitions to gss_krb5_internal.h 2023-02-20 09:20:46 -05:00
gss_generic_token.c sunrpc: Remove unneeded null check 2022-01-06 14:00:20 -05:00
gss_krb5_crypto.c SUNRPC: Fix a crash in gss_krb5_checksum() 2023-03-22 16:58:26 -04:00
gss_krb5_internal.h SUNRPC: Add encryption self-tests 2023-02-20 09:20:51 -05:00
gss_krb5_keys.c SUNRPC: Add KUnit tests for rpcsec_krb5.ko 2023-02-20 09:20:46 -05:00
gss_krb5_mech.c SUNRPC: Export get_gss_krb5_enctype() 2023-02-20 09:20:48 -05:00
gss_krb5_seal.c SUNRPC: Enable rpcsec_gss_krb5.ko to be built without CRYPTO_DES 2023-02-20 09:20:41 -05:00
gss_krb5_seqnum.c SUNRPC: Remove ->encrypt and ->decrypt methods from struct gss_krb5_enctype 2023-02-20 09:20:41 -05:00
gss_krb5_test.c SUNRPC: Fix failures of checksum Kunit tests 2023-04-17 09:42:54 -04:00
gss_krb5_unseal.c SUNRPC: Enable rpcsec_gss_krb5.ko to be built without CRYPTO_DES 2023-02-20 09:20:41 -05:00
gss_krb5_wrap.c SUNRPC: Rename .encrypt_v2 and .decrypt_v2 methods 2023-02-20 09:20:42 -05:00
gss_mech_switch.c sunrpc: clean up properly in gss_mech_unregister() 2020-05-28 18:15:00 -04:00
gss_rpc_upcall.c SUNRPC: Ensure that the gssproxy client can start in a connected state 2022-05-07 14:31:15 -04:00
gss_rpc_upcall.h SUNRPC: Add SPDX IDs to some net/sunrpc/auth_gss/ files 2019-02-14 09:54:37 -05:00
gss_rpc_xdr.c SUNRPC: Remove XDRBUF_SPARSE_PAGES flag in gss_proxy upcall 2020-12-09 09:38:34 -05:00
gss_rpc_xdr.h SUNRPC: Add SPDX IDs to some net/sunrpc/auth_gss/ files 2019-02-14 09:54:37 -05:00
Makefile SUNRPC: Add KUnit tests for rpcsec_krb5.ko 2023-02-20 09:20:46 -05:00
svcauth_gss.c SUNRPC: return proper error from get_expiry() 2023-04-26 09:05:00 -04:00
trace.c SUNRPC: remove duplicate include 2020-08-19 13:19:42 -04:00