History

sunrpc: convert to time64_t for expiry

Using signed 32-bit types for UTC time leads to the y2038 overflow, which is what happens in the sunrpc code at the moment. This changes the sunrpc code over to use time64_t where possible. The one exception is the gss_import_v{1,2}_context() function for kerberos5, which uses 32-bit timestamps in the protocol. Here, we can at least treat the numbers as 'unsigned', which extends the range from 2038 to 2106.

Arnd Bergmann committed 8 years ago

Commit 294ec5b1 parent 38c4a4c8 files · +30 −24Browse files

Showing the changes to include/linux (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/sunrpc/gss_api.h +2 −2
  2. include/linux/sunrpc/gss_krb5.h +1 −1
include/linux/sunrpc/gss_api.h+2−2
@@ -48,7 +48,7 @@ int gss_import_sec_context( · 47 unmodified lines
4848 size_t bufsize,
4949 struct gss_api_mech *mech,
5050 struct gss_ctx **ctx_id,
51− time_t *endtime,
51+ time64_t *endtime,
5252 gfp_t gfp_mask);
5353 u32 gss_get_mic(
5454 struct gss_ctx *ctx_id,
@@ -108,7 +108,7 @@ struct gss_api_ops { · 53 unmodified lines
108108 const void *input_token,
109109 size_t bufsize,
110110 struct gss_ctx *ctx_id,
111− time_t *endtime,
111+ time64_t *endtime,
112112 gfp_t gfp_mask);
113113 u32 (*gss_get_mic)(
114114 struct gss_ctx *ctx_id,
include/linux/sunrpc/gss_krb5.h+1−1
@@ -106,9 +106,9 @@ struct krb5_ctx { · 105 unmodified lines
106106 struct crypto_sync_skcipher *initiator_enc_aux;
107107 u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
108108 u8 cksum[GSS_KRB5_MAX_KEYLEN];
109− s32 endtime;
110109 atomic_t seq_send;
111110 atomic64_t seq_send64;
111+ time64_t endtime;
112112 struct xdr_netobj mech_used;
113113 u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];
114114 u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];