y2038: core, driver and file system changes
These are updates to device drivers and file systems that for some reason or another were not included in the kernel in the previous y2038 series. I've gone through all users of time_t again to make sure the kernel is in a long-term maintainable state, replacing all remaining references to time_t with safe alternatives. Some related parts of the series were picked up into the nfsd, xfs, alsa and v4l2 trees. A final set of patches in linux-mm removes the now unused time_t/timeval/timespec types and helper functions after all five branches are merged for linux-5.6, ensuring that no new users get merged. As a result, linux-5.6, or my backport of the patches to 5.4 [1], should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038, with a few remaining caveats: - All user space must be compiled with a 64-bit time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from linux-5.6 or higher. - Applications that use the system call interfaces directly need to be ported to use the time64 syscalls added in linux-5.1 in place of the existing system calls. This impacts most users of futex() and seccomp() as well as programming languages that have their own runtime environment not based on libc. - Applications that use a private copy of kernel uapi header files or their contents may need to update to the linux-5.6 version, in particular for sound/asound.h, xfs/xfs_fs.h, linux/input.h, linux/elfcore.h, linux/sockios.h, linux/timex.h and linux/can/bcm.h. - A few remaining interfaces cannot be changed to pass a 64-bit time_t in a compatible way, so they must be configured to use CLOCK_MONOTONIC times or (with a y2106 problem) unsigned 32-bit timestamps. Most importantly this impacts all users of 'struct input_event'. - All y2038 problems that are present on 64-bit machines also apply to 32-bit machines. In particular this affects file systems with on-disk timestamps using signed 32-bit seconds: ext4 with ext3-style small inodes, ext2, xfs (to be fixed soon) and ufs. Changes since v1 [2]: - Add Acks I received - Rebase to v5.5-rc1, dropping patches that got merged already - Add NFS, XFS and the final three patches from another series - Rewrite etnaviv patches - Add one late revert to avoid an etnaviv regression [1] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-endgame [2] https://lore.kernel.org/lkml/20191108213257.3097633-1-arnd@arndb.de/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJeMYy3AAoJEGCrR//JCVInEGwP/0R+S+ok7vw9OdLVT0lFl07D IcVabgOWf24imN7m7L7Mlt3nDfxIT4tMpiAXq7eMO3spcyViG18O2LXdSQ4/7QBp +BlhoMjOP9w34Jyd7mnkFr4vqQALvfIqkS8rFObDtDub2Rfj9PC36MRMIu8BPXlv RK8bigwJeH/DV38yc5/JeUcD+WuewYLsK9XPWN+4yB4vgGsNU3ZQQ6nnzbR3hMsN DN8WZ68Y7IBs0Kyxkf+s2zmRXtCa2RiFg/2TUsk5olVAJVaenvte69hq5RSbg1vW vLi6K8cBoPWL59nqCzcNE+TUhSUg3LOj/a/KWyl76yovz7AlJaNjssOf8ZjHw6sL MhQqz3hXTxiJDS2Jvbf1yojiYGlzrq/gqcRFGe9jPcZdieMc4/yZCx60G/Exa5Pu YdMcqMyDWPFyUAFQNWEF59HPheOdj6tb1KpJ6bwgCo3P7QqhLrU4z9w3Py4/ZfBO 4sWcWteSsD6MN/ADJ2WQ56nNxzM2AvkeVJKcF6FCkdngXX9T0GExmZz7SqB5Du99 9lNjIiD5E+LBa/Swo/7n49aYa8x06V1pmHYTZVh9Wkl+CZiO21umezQFrWsfaMTp xt3c6pFdMG5xNMGpreTAXOmf2R+T6O8IO2qQq/TYjzqOLH7QC830P7avkmml+cK1 LjOBE2TfSeO8Ru1dXV4t =wx0A -----END PGP SIGNATURE----- Merge tag 'y2038-drivers-for-v5.6-signed' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground Pull y2038 updates from Arnd Bergmann: "Core, driver and file system changes These are updates to device drivers and file systems that for some reason or another were not included in the kernel in the previous y2038 series. I've gone through all users of time_t again to make sure the kernel is in a long-term maintainable state, replacing all remaining references to time_t with safe alternatives. Some related parts of the series were picked up into the nfsd, xfs, alsa and v4l2 trees. A final set of patches in linux-mm removes the now unused time_t/timeval/timespec types and helper functions after all five branches are merged for linux-5.6, ensuring that no new users get merged. As a result, linux-5.6, or my backport of the patches to 5.4 [1], should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038, with a few remaining caveats: - All user space must be compiled with a 64-bit time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from linux-5.6 or higher. - Applications that use the system call interfaces directly need to be ported to use the time64 syscalls added in linux-5.1 in place of the existing system calls. This impacts most users of futex() and seccomp() as well as programming languages that have their own runtime environment not based on libc. - Applications that use a private copy of kernel uapi header files or their contents may need to update to the linux-5.6 version, in particular for sound/asound.h, xfs/xfs_fs.h, linux/input.h, linux/elfcore.h, linux/sockios.h, linux/timex.h and linux/can/bcm.h. - A few remaining interfaces cannot be changed to pass a 64-bit time_t in a compatible way, so they must be configured to use CLOCK_MONOTONIC times or (with a y2106 problem) unsigned 32-bit timestamps. Most importantly this impacts all users of 'struct input_event'. - All y2038 problems that are present on 64-bit machines also apply to 32-bit machines. In particular this affects file systems with on-disk timestamps using signed 32-bit seconds: ext4 with ext3-style small inodes, ext2, xfs (to be fixed soon) and ufs" [1] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-endgame * tag 'y2038-drivers-for-v5.6-signed' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground: (21 commits) Revert "drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC" y2038: sh: remove timeval/timespec usage from headers y2038: sparc: remove use of struct timex y2038: rename itimerval to __kernel_old_itimerval y2038: remove obsolete jiffies conversion functions nfs: fscache: use timespec64 in inode auxdata nfs: fix timstamp debug prints nfs: use time64_t internally sunrpc: convert to time64_t for expiry drm/etnaviv: avoid deprecated timespec drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC drm/msm: avoid using 'timespec' hfs/hfsplus: use 64-bit inode timestamps hostfs: pass 64-bit timestamps to/from user space packet: clarify timestamp overflow tsacct: add 64-bit btime field acct: stop using get_seconds() um: ubd: use 64-bit time_t where possible xtensa: ISS: avoid struct timeval dlm: use SO_SNDTIMEO_NEW instead of SO_SNDTIMEO_OLD ...
This commit is contained in:
commit
22b17db4ea
49 changed files with 283 additions and 266 deletions
|
|
@ -422,26 +422,6 @@ static __always_inline unsigned long usecs_to_jiffies(const unsigned int u)
|
|||
extern unsigned long timespec64_to_jiffies(const struct timespec64 *value);
|
||||
extern void jiffies_to_timespec64(const unsigned long jiffies,
|
||||
struct timespec64 *value);
|
||||
static inline unsigned long timespec_to_jiffies(const struct timespec *value)
|
||||
{
|
||||
struct timespec64 ts = timespec_to_timespec64(*value);
|
||||
|
||||
return timespec64_to_jiffies(&ts);
|
||||
}
|
||||
|
||||
static inline void jiffies_to_timespec(const unsigned long jiffies,
|
||||
struct timespec *value)
|
||||
{
|
||||
struct timespec64 ts;
|
||||
|
||||
jiffies_to_timespec64(jiffies, &ts);
|
||||
*value = timespec64_to_timespec(ts);
|
||||
}
|
||||
|
||||
extern unsigned long timeval_to_jiffies(const struct timeval *value);
|
||||
extern void jiffies_to_timeval(const unsigned long jiffies,
|
||||
struct timeval *value);
|
||||
|
||||
extern clock_t jiffies_to_clock_t(unsigned long x);
|
||||
static inline clock_t jiffies_delta_to_clock_t(long delta)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@
|
|||
*/
|
||||
struct cache_head {
|
||||
struct hlist_node cache_list;
|
||||
time_t expiry_time; /* After time time, don't use the data */
|
||||
time_t last_refresh; /* If CACHE_PENDING, this is when upcall was
|
||||
time64_t expiry_time; /* After time time, don't use the data */
|
||||
time64_t last_refresh; /* If CACHE_PENDING, this is when upcall was
|
||||
* sent, else this is when update was
|
||||
* received, though it is alway set to
|
||||
* be *after* ->flush_time.
|
||||
|
|
@ -95,22 +95,22 @@ struct cache_detail {
|
|||
/* fields below this comment are for internal use
|
||||
* and should not be touched by cache owners
|
||||
*/
|
||||
time_t flush_time; /* flush all cache items with
|
||||
time64_t flush_time; /* flush all cache items with
|
||||
* last_refresh at or earlier
|
||||
* than this. last_refresh
|
||||
* is never set at or earlier
|
||||
* than this.
|
||||
*/
|
||||
struct list_head others;
|
||||
time_t nextcheck;
|
||||
time64_t nextcheck;
|
||||
int entries;
|
||||
|
||||
/* fields for communication over channel */
|
||||
struct list_head queue;
|
||||
|
||||
atomic_t writers; /* how many time is /channel open */
|
||||
time_t last_close; /* if no writers, when did last close */
|
||||
time_t last_warn; /* when we last warned about no writers */
|
||||
time64_t last_close; /* if no writers, when did last close */
|
||||
time64_t last_warn; /* when we last warned about no writers */
|
||||
|
||||
union {
|
||||
struct proc_dir_entry *procfs;
|
||||
|
|
@ -147,18 +147,22 @@ struct cache_deferred_req {
|
|||
* timestamps kept in the cache are expressed in seconds
|
||||
* since boot. This is the best for measuring differences in
|
||||
* real time.
|
||||
* This reimplemnts ktime_get_boottime_seconds() in a slightly
|
||||
* faster but less accurate way. When we end up converting
|
||||
* back to wallclock (CLOCK_REALTIME), that error often
|
||||
* cancels out during the reverse operation.
|
||||
*/
|
||||
static inline time_t seconds_since_boot(void)
|
||||
static inline time64_t seconds_since_boot(void)
|
||||
{
|
||||
struct timespec boot;
|
||||
getboottime(&boot);
|
||||
return get_seconds() - boot.tv_sec;
|
||||
struct timespec64 boot;
|
||||
getboottime64(&boot);
|
||||
return ktime_get_real_seconds() - boot.tv_sec;
|
||||
}
|
||||
|
||||
static inline time_t convert_to_wallclock(time_t sinceboot)
|
||||
static inline time64_t convert_to_wallclock(time64_t sinceboot)
|
||||
{
|
||||
struct timespec boot;
|
||||
getboottime(&boot);
|
||||
struct timespec64 boot;
|
||||
getboottime64(&boot);
|
||||
return boot.tv_sec + sinceboot;
|
||||
}
|
||||
|
||||
|
|
@ -273,7 +277,7 @@ static inline int get_uint(char **bpp, unsigned int *anint)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int get_time(char **bpp, time_t *time)
|
||||
static inline int get_time(char **bpp, time64_t *time)
|
||||
{
|
||||
char buf[50];
|
||||
long long ll;
|
||||
|
|
@ -287,20 +291,20 @@ static inline int get_time(char **bpp, time_t *time)
|
|||
if (kstrtoll(buf, 0, &ll))
|
||||
return -EINVAL;
|
||||
|
||||
*time = (time_t)ll;
|
||||
*time = ll;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline time_t get_expiry(char **bpp)
|
||||
static inline time64_t get_expiry(char **bpp)
|
||||
{
|
||||
time_t rv;
|
||||
struct timespec boot;
|
||||
time64_t rv;
|
||||
struct timespec64 boot;
|
||||
|
||||
if (get_time(bpp, &rv))
|
||||
return 0;
|
||||
if (rv < 0)
|
||||
return 0;
|
||||
getboottime(&boot);
|
||||
getboottime64(&boot);
|
||||
return rv - boot.tv_sec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ int gss_import_sec_context(
|
|||
size_t bufsize,
|
||||
struct gss_api_mech *mech,
|
||||
struct gss_ctx **ctx_id,
|
||||
time_t *endtime,
|
||||
time64_t *endtime,
|
||||
gfp_t gfp_mask);
|
||||
u32 gss_get_mic(
|
||||
struct gss_ctx *ctx_id,
|
||||
|
|
@ -108,7 +108,7 @@ struct gss_api_ops {
|
|||
const void *input_token,
|
||||
size_t bufsize,
|
||||
struct gss_ctx *ctx_id,
|
||||
time_t *endtime,
|
||||
time64_t *endtime,
|
||||
gfp_t gfp_mask);
|
||||
u32 (*gss_get_mic)(
|
||||
struct gss_ctx *ctx_id,
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ struct krb5_ctx {
|
|||
struct crypto_sync_skcipher *initiator_enc_aux;
|
||||
u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
|
||||
u8 cksum[GSS_KRB5_MAX_KEYLEN];
|
||||
s32 endtime;
|
||||
atomic_t seq_send;
|
||||
atomic64_t seq_send64;
|
||||
time64_t endtime;
|
||||
struct xdr_netobj mech_used;
|
||||
u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];
|
||||
u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ struct inode;
|
|||
struct iocb;
|
||||
struct io_event;
|
||||
struct iovec;
|
||||
struct itimerspec;
|
||||
struct itimerval;
|
||||
struct __kernel_old_itimerval;
|
||||
struct kexec_segment;
|
||||
struct linux_dirent;
|
||||
struct linux_dirent64;
|
||||
|
|
@ -594,10 +593,10 @@ asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp,
|
|||
struct old_timespec32 __user *rmtp);
|
||||
|
||||
/* kernel/itimer.c */
|
||||
asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
|
||||
asmlinkage long sys_getitimer(int which, struct __kernel_old_itimerval __user *value);
|
||||
asmlinkage long sys_setitimer(int which,
|
||||
struct itimerval __user *value,
|
||||
struct itimerval __user *ovalue);
|
||||
struct __kernel_old_itimerval __user *value,
|
||||
struct __kernel_old_itimerval __user *ovalue);
|
||||
|
||||
/* kernel/kexec.c */
|
||||
asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue