Skip to content

Commit b1b988a

Browse files
committed
Merge branch 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/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 ...
2 parents edaed16 + cfbe271 commit b1b988a

File tree

107 files changed

+1655
-1264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1655
-1264
lines changed

arch/Kconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@ config ARCH_THREAD_STACK_ALLOCATOR
276276
config ARCH_WANTS_DYNAMIC_TASK_STRUCT
277277
bool
278278

279+
config ARCH_32BIT_OFF_T
280+
bool
281+
depends on !64BIT
282+
help
283+
All new 32-bit architectures should have 64-bit off_t type on
284+
userspace side which corresponds to the loff_t kernel type. This
285+
is the requirement for modern ABIs. Some existing architectures
286+
still support 32-bit off_t. This option is enabled for all such
287+
architectures explicitly.
288+
279289
config HAVE_REGS_AND_STACK_ACCESS_API
280290
bool
281291
help
@@ -759,7 +769,7 @@ config 64BIT_TIME
759769
handling.
760770

761771
config COMPAT_32BIT_TIME
762-
def_bool (!64BIT && 64BIT_TIME) || COMPAT
772+
def_bool !64BIT || COMPAT
763773
help
764774
This enables 32 bit time_t support in addition to 64 bit time_t support.
765775
This is relevant on all 32-bit architectures, and 64-bit architectures

arch/alpha/include/asm/unistd.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,4 @@
1919
#define __ARCH_WANT_SYS_VFORK
2020
#define __ARCH_WANT_SYS_CLONE
2121

22-
/*
23-
* Ignore legacy syscalls that we don't use.
24-
*/
25-
#define __IGNORE_alarm
26-
#define __IGNORE_creat
27-
#define __IGNORE_getegid
28-
#define __IGNORE_geteuid
29-
#define __IGNORE_getgid
30-
#define __IGNORE_getpid
31-
#define __IGNORE_getppid
32-
#define __IGNORE_getuid
33-
#define __IGNORE_pause
34-
#define __IGNORE_time
35-
#define __IGNORE_utime
36-
#define __IGNORE_umount2
37-
38-
/* Alpha doesn't have protection keys. */
39-
#define __IGNORE_pkey_mprotect
40-
#define __IGNORE_pkey_alloc
41-
#define __IGNORE_pkey_free
42-
4322
#endif /* _ALPHA_UNISTD_H */

arch/alpha/include/uapi/asm/unistd.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
#ifndef _UAPI_ALPHA_UNISTD_H
33
#define _UAPI_ALPHA_UNISTD_H
44

5+
/* These are traditionally the names linux-alpha uses for
6+
* the two otherwise generic system calls */
7+
#define __NR_umount __NR_umount2
8+
#define __NR_osf_shmat __NR_shmat
9+
10+
/* These return an extra value but can be used as aliases */
11+
#define __NR_getpid __NR_getxpid
12+
#define __NR_getuid __NR_getxuid
13+
#define __NR_getgid __NR_getxgid
14+
515
#include <asm/unistd_32.h>
616

717
#endif /* _UAPI_ALPHA_UNISTD_H */

arch/alpha/kernel/osf_sys.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ struct timex32 {
12531253

12541254
SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
12551255
{
1256-
struct timex txc;
1256+
struct __kernel_timex txc;
12571257
int ret;
12581258

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

12761277
return ret;

arch/alpha/kernel/syscalls/syscall.tbl

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
19 common lseek sys_lseek
3030
20 common getxpid sys_getxpid
3131
21 common osf_mount sys_osf_mount
32-
22 common umount sys_umount
32+
22 common umount2 sys_umount
3333
23 common setuid sys_setuid
3434
24 common getxuid sys_getxuid
3535
25 common exec_with_loader sys_ni_syscall
@@ -174,17 +174,17 @@
174174
187 common osf_alt_sigpending sys_ni_syscall
175175
188 common osf_alt_setsid sys_ni_syscall
176176
199 common osf_swapon sys_swapon
177-
200 common msgctl sys_msgctl
177+
200 common msgctl sys_old_msgctl
178178
201 common msgget sys_msgget
179179
202 common msgrcv sys_msgrcv
180180
203 common msgsnd sys_msgsnd
181-
204 common semctl sys_semctl
181+
204 common semctl sys_old_semctl
182182
205 common semget sys_semget
183183
206 common semop sys_semop
184184
207 common osf_utsname sys_osf_utsname
185185
208 common lchown sys_lchown
186-
209 common osf_shmat sys_shmat
187-
210 common shmctl sys_shmctl
186+
209 common shmat sys_shmat
187+
210 common shmctl sys_old_shmctl
188188
211 common shmdt sys_shmdt
189189
212 common shmget sys_shmget
190190
213 common osf_mvalid sys_ni_syscall
@@ -451,3 +451,15 @@
451451
520 common preadv2 sys_preadv2
452452
521 common pwritev2 sys_pwritev2
453453
522 common statx sys_statx
454+
523 common io_pgetevents sys_io_pgetevents
455+
524 common pkey_mprotect sys_pkey_mprotect
456+
525 common pkey_alloc sys_pkey_alloc
457+
526 common pkey_free sys_pkey_free
458+
527 common rseq sys_rseq
459+
528 common statfs64 sys_statfs64
460+
529 common fstatfs64 sys_fstatfs64
461+
530 common getegid sys_getegid
462+
531 common geteuid sys_geteuid
463+
532 common getppid sys_getppid
464+
# all other architectures have common numbers for new syscall, alpha
465+
# is the exception.

arch/arc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config ARC
1414
select ARCH_HAS_SYNC_DMA_FOR_CPU
1515
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
1616
select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
17+
select ARCH_32BIT_OFF_T
1718
select BUILDTIME_EXTABLE_SORT
1819
select CLONE_BACKWARDS
1920
select COMMON_CLK

arch/arc/include/uapi/asm/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818

1919
#define __ARCH_WANT_RENAMEAT
2020
#define __ARCH_WANT_STAT64
21+
#define __ARCH_WANT_SET_GET_RLIMIT
2122
#define __ARCH_WANT_SYS_EXECVE
2223
#define __ARCH_WANT_SYS_CLONE
2324
#define __ARCH_WANT_SYS_VFORK
2425
#define __ARCH_WANT_SYS_FORK
26+
#define __ARCH_WANT_TIME32_SYSCALLS
2527

2628
#define sys_mmap2 sys_mmap_pgoff
2729

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config ARM
33
bool
44
default y
5+
select ARCH_32BIT_OFF_T
56
select ARCH_CLOCKSOURCE_DATA
67
select ARCH_DISCARD_MEMBLOCK if !HAVE_ARCH_PFN_VALID && !KEXEC
78
select ARCH_HAS_DEBUG_VIRTUAL if MMU

arch/arm/include/asm/unistd.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
#define __ARCH_WANT_SYS_SIGPROCMASK
2727
#define __ARCH_WANT_SYS_OLD_MMAP
2828
#define __ARCH_WANT_SYS_OLD_SELECT
29-
#define __ARCH_WANT_SYS_UTIME
29+
#define __ARCH_WANT_SYS_UTIME32
3030

3131
#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
32-
#define __ARCH_WANT_SYS_TIME
32+
#define __ARCH_WANT_SYS_TIME32
3333
#define __ARCH_WANT_SYS_IPC
3434
#define __ARCH_WANT_SYS_OLDUMOUNT
3535
#define __ARCH_WANT_SYS_ALARM
@@ -45,7 +45,6 @@
4545
* Unimplemented (or alternatively implemented) syscalls
4646
*/
4747
#define __IGNORE_fadvise64_64
48-
#define __IGNORE_migrate_pages
4948

5049
#ifdef __ARM_EABI__
5150
/*

arch/arm/kernel/sys_oabi-compat.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,10 @@ struct oabi_sembuf {
317317
asmlinkage long sys_oabi_semtimedop(int semid,
318318
struct oabi_sembuf __user *tsops,
319319
unsigned nsops,
320-
const struct timespec __user *timeout)
320+
const struct old_timespec32 __user *timeout)
321321
{
322322
struct sembuf *sops;
323-
struct timespec local_timeout;
323+
struct old_timespec32 local_timeout;
324324
long err;
325325
int i;
326326

@@ -350,7 +350,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
350350
} else {
351351
mm_segment_t fs = get_fs();
352352
set_fs(KERNEL_DS);
353-
err = sys_semtimedop(semid, sops, nsops, timeout);
353+
err = sys_semtimedop_time32(semid, sops, nsops, timeout);
354354
set_fs(fs);
355355
}
356356
kfree(sops);
@@ -375,7 +375,7 @@ asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
375375
return sys_oabi_semtimedop(first,
376376
(struct oabi_sembuf __user *)ptr,
377377
second,
378-
(const struct timespec __user *)fifth);
378+
(const struct old_timespec32 __user *)fifth);
379379
default:
380380
return sys_ipc(call, first, second, third, ptr, fifth);
381381
}

0 commit comments

Comments
 (0)