Skip to content

Commit

Permalink
Merge branch 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull year 2038 updates from Thomas Gleixner:
 "Another round of changes to make the kernel ready for 2038. After lots
  of preparatory work this is the first set of syscalls which are 2038
  safe:

    403 clock_gettime64
    404 clock_settime64
    405 clock_adjtime64
    406 clock_getres_time64
    407 clock_nanosleep_time64
    408 timer_gettime64
    409 timer_settime64
    410 timerfd_gettime64
    411 timerfd_settime64
    412 utimensat_time64
    413 pselect6_time64
    414 ppoll_time64
    416 io_pgetevents_time64
    417 recvmmsg_time64
    418 mq_timedsend_time64
    419 mq_timedreceiv_time64
    420 semtimedop_time64
    421 rt_sigtimedwait_time64
    422 futex_time64
    423 sched_rr_get_interval_time64

  The syscall numbers are identical all over the architectures"

* 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
  riscv: Use latest system call ABI
  checksyscalls: fix up mq_timedreceive and stat exceptions
  unicore32: Fix __ARCH_WANT_STAT64 definition
  asm-generic: Make time32 syscall numbers optional
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  compat ABI: use non-compat openat and open_by_handle_at variants
  y2038: add 64-bit time_t syscalls to all 32-bit architectures
  y2038: rename old time and utime syscalls
  y2038: remove struct definition redirects
  y2038: use time32 syscall names on 32-bit
  syscalls: remove obsolete __IGNORE_ macros
  y2038: syscalls: rename y2038 compat syscalls
  x86/x32: use time64 versions of sigtimedwait and recvmmsg
  timex: change syscalls to use struct __kernel_timex
  timex: use __kernel_timex internally
  sparc64: add custom adjtimex/clock_adjtime functions
  time: fix sys_timer_settime prototype
  time: Add struct __kernel_timex
  time: make adjtime compat handling available for 32 bit
  ...
  • Loading branch information
torvalds committed Mar 5, 2019
2 parents edaed16 + cfbe271 commit b1b988a
Show file tree
Hide file tree
Showing 107 changed files with 1,655 additions and 1,264 deletions.
12 changes: 11 additions & 1 deletion arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ config ARCH_THREAD_STACK_ALLOCATOR
config ARCH_WANTS_DYNAMIC_TASK_STRUCT
bool

config ARCH_32BIT_OFF_T
bool
depends on !64BIT
help
All new 32-bit architectures should have 64-bit off_t type on
userspace side which corresponds to the loff_t kernel type. This
is the requirement for modern ABIs. Some existing architectures
still support 32-bit off_t. This option is enabled for all such
architectures explicitly.

config HAVE_REGS_AND_STACK_ACCESS_API
bool
help
Expand Down Expand Up @@ -759,7 +769,7 @@ config 64BIT_TIME
handling.

config COMPAT_32BIT_TIME
def_bool (!64BIT && 64BIT_TIME) || COMPAT
def_bool !64BIT || COMPAT
help
This enables 32 bit time_t support in addition to 64 bit time_t support.
This is relevant on all 32-bit architectures, and 64-bit architectures
Expand Down
21 changes: 0 additions & 21 deletions arch/alpha/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,4 @@
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE

/*
* Ignore legacy syscalls that we don't use.
*/
#define __IGNORE_alarm
#define __IGNORE_creat
#define __IGNORE_getegid
#define __IGNORE_geteuid
#define __IGNORE_getgid
#define __IGNORE_getpid
#define __IGNORE_getppid
#define __IGNORE_getuid
#define __IGNORE_pause
#define __IGNORE_time
#define __IGNORE_utime
#define __IGNORE_umount2

/* Alpha doesn't have protection keys. */
#define __IGNORE_pkey_mprotect
#define __IGNORE_pkey_alloc
#define __IGNORE_pkey_free

#endif /* _ALPHA_UNISTD_H */
10 changes: 10 additions & 0 deletions arch/alpha/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
#ifndef _UAPI_ALPHA_UNISTD_H
#define _UAPI_ALPHA_UNISTD_H

/* These are traditionally the names linux-alpha uses for
* the two otherwise generic system calls */
#define __NR_umount __NR_umount2
#define __NR_osf_shmat __NR_shmat

/* These return an extra value but can be used as aliases */
#define __NR_getpid __NR_getxpid
#define __NR_getuid __NR_getxuid
#define __NR_getgid __NR_getxgid

#include <asm/unistd_32.h>

#endif /* _UAPI_ALPHA_UNISTD_H */
5 changes: 3 additions & 2 deletions arch/alpha/kernel/osf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ struct timex32 {

SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
{
struct timex txc;
struct __kernel_timex txc;
int ret;

/* copy relevant bits of struct timex. */
Expand All @@ -1270,7 +1270,8 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
if (copy_to_user(txc_p, &txc, offsetof(struct timex32, time)) ||
(copy_to_user(&txc_p->tick, &txc.tick, sizeof(struct timex32) -
offsetof(struct timex32, tick))) ||
(put_tv_to_tv32(&txc_p->time, &txc.time)))
(put_user(txc.time.tv_sec, &txc_p->time.tv_sec)) ||
(put_user(txc.time.tv_usec, &txc_p->time.tv_usec)))
return -EFAULT;

return ret;
Expand Down
22 changes: 17 additions & 5 deletions arch/alpha/kernel/syscalls/syscall.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
19 common lseek sys_lseek
20 common getxpid sys_getxpid
21 common osf_mount sys_osf_mount
22 common umount sys_umount
22 common umount2 sys_umount
23 common setuid sys_setuid
24 common getxuid sys_getxuid
25 common exec_with_loader sys_ni_syscall
Expand Down Expand Up @@ -174,17 +174,17 @@
187 common osf_alt_sigpending sys_ni_syscall
188 common osf_alt_setsid sys_ni_syscall
199 common osf_swapon sys_swapon
200 common msgctl sys_msgctl
200 common msgctl sys_old_msgctl
201 common msgget sys_msgget
202 common msgrcv sys_msgrcv
203 common msgsnd sys_msgsnd
204 common semctl sys_semctl
204 common semctl sys_old_semctl
205 common semget sys_semget
206 common semop sys_semop
207 common osf_utsname sys_osf_utsname
208 common lchown sys_lchown
209 common osf_shmat sys_shmat
210 common shmctl sys_shmctl
209 common shmat sys_shmat
210 common shmctl sys_old_shmctl
211 common shmdt sys_shmdt
212 common shmget sys_shmget
213 common osf_mvalid sys_ni_syscall
Expand Down Expand Up @@ -451,3 +451,15 @@
520 common preadv2 sys_preadv2
521 common pwritev2 sys_pwritev2
522 common statx sys_statx
523 common io_pgetevents sys_io_pgetevents
524 common pkey_mprotect sys_pkey_mprotect
525 common pkey_alloc sys_pkey_alloc
526 common pkey_free sys_pkey_free
527 common rseq sys_rseq
528 common statfs64 sys_statfs64
529 common fstatfs64 sys_fstatfs64
530 common getegid sys_getegid
531 common geteuid sys_geteuid
532 common getppid sys_getppid
# all other architectures have common numbers for new syscall, alpha
# is the exception.
1 change: 1 addition & 0 deletions arch/arc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ config ARC
select ARCH_HAS_SYNC_DMA_FOR_CPU
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
select ARCH_32BIT_OFF_T
select BUILDTIME_EXTABLE_SORT
select CLONE_BACKWARDS
select COMMON_CLK
Expand Down
2 changes: 2 additions & 0 deletions arch/arc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_TIME32_SYSCALLS

#define sys_mmap2 sys_mmap_pgoff

Expand Down
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config ARM
bool
default y
select ARCH_32BIT_OFF_T
select ARCH_CLOCKSOURCE_DATA
select ARCH_DISCARD_MEMBLOCK if !HAVE_ARCH_PFN_VALID && !KEXEC
select ARCH_HAS_DEBUG_VIRTUAL if MMU
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_OLD_MMAP
#define __ARCH_WANT_SYS_OLD_SELECT
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_UTIME32

#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_TIME32
#define __ARCH_WANT_SYS_IPC
#define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_ALARM
Expand All @@ -45,7 +45,6 @@
* Unimplemented (or alternatively implemented) syscalls
*/
#define __IGNORE_fadvise64_64
#define __IGNORE_migrate_pages

#ifdef __ARM_EABI__
/*
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/kernel/sys_oabi-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ struct oabi_sembuf {
asmlinkage long sys_oabi_semtimedop(int semid,
struct oabi_sembuf __user *tsops,
unsigned nsops,
const struct timespec __user *timeout)
const struct old_timespec32 __user *timeout)
{
struct sembuf *sops;
struct timespec local_timeout;
struct old_timespec32 local_timeout;
long err;
int i;

Expand Down Expand Up @@ -350,7 +350,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
} else {
mm_segment_t fs = get_fs();
set_fs(KERNEL_DS);
err = sys_semtimedop(semid, sops, nsops, timeout);
err = sys_semtimedop_time32(semid, sops, nsops, timeout);
set_fs(fs);
}
kfree(sops);
Expand All @@ -375,7 +375,7 @@ asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
return sys_oabi_semtimedop(first,
(struct oabi_sembuf __user *)ptr,
second,
(const struct timespec __user *)fifth);
(const struct old_timespec32 __user *)fifth);
default:
return sys_ipc(call, first, second, third, ptr, fifth);
}
Expand Down
Loading

0 comments on commit b1b988a

Please sign in to comment.