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 7 years ago

Commit 52879b41 parent ce8866f8 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
48 size_t bufsize,48 size_t bufsize,
49 struct gss_api_mech *mech,49 struct gss_api_mech *mech,
50 struct gss_ctx **ctx_id,50 struct gss_ctx **ctx_id,
51 time_t *endtime,51 time64_t *endtime,
52 gfp_t gfp_mask);52 gfp_t gfp_mask);
53u32 gss_get_mic(53u32 gss_get_mic(
54 struct gss_ctx *ctx_id,54 struct gss_ctx *ctx_id,
@@ -108,7 +108,7 @@ struct gss_api_ops { · 53 unmodified lines
108 const void *input_token,108 const void *input_token,
109 size_t bufsize,109 size_t bufsize,
110 struct gss_ctx *ctx_id,110 struct gss_ctx *ctx_id,
111 time_t *endtime,111 time64_t *endtime,
112 gfp_t gfp_mask);112 gfp_t gfp_mask);
113 u32 (*gss_get_mic)(113 u32 (*gss_get_mic)(
114 struct gss_ctx *ctx_id,114 struct gss_ctx *ctx_id,
include/linux/sunrpc/gss_krb5.h+1−1
@@ -106,9 +106,9 @@ struct krb5_ctx { · 105 unmodified lines
106 struct crypto_sync_skcipher *initiator_enc_aux;106 struct crypto_sync_skcipher *initiator_enc_aux;
107 u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */107 u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
108 u8 cksum[GSS_KRB5_MAX_KEYLEN];108 u8 cksum[GSS_KRB5_MAX_KEYLEN];
109 s32 endtime;
110 atomic_t seq_send;109 atomic_t seq_send;
111 atomic64_t seq_send64;110 atomic64_t seq_send64;
111 time64_t endtime;
112 struct xdr_netobj mech_used;112 struct xdr_netobj mech_used;
113 u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];113 u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];
114 u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];114 u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t