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.
Showing the changes to include/linux (2 of 8 files). Show all
Unified · Split
| @@ -48,7 +48,7 @@ int gss_import_sec_context( · 47 unmodified lines | ||
| 48 | 48 | size_t bufsize, |
| 49 | 49 | struct gss_api_mech *mech, |
| 50 | 50 | struct gss_ctx **ctx_id, |
| 51 | − time_t *endtime, | |
| 51 | + time64_t *endtime, | |
| 52 | 52 | gfp_t gfp_mask); |
| 53 | 53 | u32 gss_get_mic( |
| 54 | 54 | struct gss_ctx *ctx_id, |
| @@ -108,7 +108,7 @@ struct gss_api_ops { · 53 unmodified lines | ||
| 108 | 108 | const void *input_token, |
| 109 | 109 | size_t bufsize, |
| 110 | 110 | struct gss_ctx *ctx_id, |
| 111 | − time_t *endtime, | |
| 111 | + time64_t *endtime, | |
| 112 | 112 | gfp_t gfp_mask); |
| 113 | 113 | u32 (*gss_get_mic)( |
| 114 | 114 | struct gss_ctx *ctx_id, |
| @@ -106,9 +106,9 @@ struct krb5_ctx { · 105 unmodified lines | ||
| 106 | 106 | struct crypto_sync_skcipher *initiator_enc_aux; |
| 107 | 107 | u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */ |
| 108 | 108 | u8 cksum[GSS_KRB5_MAX_KEYLEN]; |
| 109 | − s32 endtime; | |
| 110 | 109 | atomic_t seq_send; |
| 111 | 110 | atomic64_t seq_send64; |
| 111 | + time64_t endtime; | |
| 112 | 112 | struct xdr_netobj mech_used; |
| 113 | 113 | u8 initiator_sign[GSS_KRB5_MAX_KEYLEN]; |
| 114 | 114 | u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN]; |