Skip to content

Commit cfbe271

Browse files
committed
Merge tag 'y2038-syscall-abi' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground into timers/2038
Pull additional syscall ABI cleanup for y2038 from Arnd Bergmann: This is a follow-up to the y2038 syscall patches already merged in the tip tree. As the final 32-bit RISC-V syscall ABI is still being decided on, this is the last chance to make a few corrections to leave out interfaces based on 32-bit time_t along with the old off_t and rlimit types. The series achieves this in a few steps: - A couple of bug fixes for minor regressions I introduced in the original series - A couple of older patches from Yury Norov that I had never merged in the past, these fix up the openat/open_by_handle_at and getrlimit/setrlimit syscalls to disallow the old versions of off_t and rlimit. - Hiding the deprecated system calls behind an #ifdef in include/uapi/asm-generic/unistd.h - Change arch/riscv to drop all these ABIs. Originally, the plan was to also leave these out on C-Sky, but that now has a glibc port that uses the older interfaces, so we need to leave them in place.
2 parents 41ea391 + d4c08b9 commit cfbe271

File tree

36 files changed

+110
-8
lines changed

36 files changed

+110
-8
lines changed

arch/Kconfig

Lines changed: 10 additions & 0 deletions
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

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/arm64/include/uapi/asm/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717

1818
#define __ARCH_WANT_RENAMEAT
1919
#define __ARCH_WANT_NEW_STAT
20+
#define __ARCH_WANT_SET_GET_RLIMIT
21+
#define __ARCH_WANT_TIME32_SYSCALLS
2022

2123
#include <asm-generic/unistd.h>

arch/c6x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
config C6X
88
def_bool y
9+
select ARCH_32BIT_OFF_T
910
select ARCH_HAS_SYNC_DMA_FOR_CPU
1011
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
1112
select CLKDEV_LOOKUP

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
#define __ARCH_WANT_RENAMEAT
1919
#define __ARCH_WANT_STAT64
20+
#define __ARCH_WANT_SET_GET_RLIMIT
2021
#define __ARCH_WANT_SYS_CLONE
22+
#define __ARCH_WANT_TIME32_SYSCALLS
2123

2224
/* Use the standard ABI for syscalls. */
2325
#include <asm-generic/unistd.h>

arch/csky/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config CSKY
22
def_bool y
3+
select ARCH_32BIT_OFF_T
34
select ARCH_HAS_SYNC_DMA_FOR_CPU
45
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
56
select ARCH_USE_BUILTIN_BSWAP

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
33

44
#define __ARCH_WANT_SYS_CLONE
5+
#define __ARCH_WANT_SET_GET_RLIMIT
6+
#define __ARCH_WANT_TIME32_SYSCALLS
57
#include <asm-generic/unistd.h>
68

79
#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)

arch/h8300/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config H8300
33
def_bool y
4+
select ARCH_32BIT_OFF_T
45
select GENERIC_ATOMIC64
56
select HAVE_UID16
67
select VIRT_TO_BUS

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22

33
#define __ARCH_WANT_RENAMEAT
44
#define __ARCH_WANT_STAT64
5+
#define __ARCH_WANT_SET_GET_RLIMIT
6+
#define __ARCH_WANT_TIME32_SYSCALLS
57

68
#include <asm-generic/unistd.h>

arch/hexagon/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ comment "Linux Kernel Configuration for Hexagon"
44

55
config HEXAGON
66
def_bool y
7+
select ARCH_32BIT_OFF_T
78
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
89
select ARCH_NO_PREEMPT
910
select HAVE_OPROFILE

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
#define sys_mmap2 sys_mmap_pgoff
3131
#define __ARCH_WANT_RENAMEAT
3232
#define __ARCH_WANT_STAT64
33+
#define __ARCH_WANT_SET_GET_RLIMIT
3334
#define __ARCH_WANT_SYS_EXECVE
3435
#define __ARCH_WANT_SYS_CLONE
3536
#define __ARCH_WANT_SYS_VFORK
3637
#define __ARCH_WANT_SYS_FORK
38+
#define __ARCH_WANT_TIME32_SYSCALLS
3739

3840
#include <asm-generic/unistd.h>

arch/m68k/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config M68K
33
bool
44
default y
5+
select ARCH_32BIT_OFF_T
56
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA
67
select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
78
select ARCH_NO_COHERENT_DMA_MMAP if !MMU

arch/microblaze/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config MICROBLAZE
22
def_bool y
3+
select ARCH_32BIT_OFF_T
34
select ARCH_NO_SWAP
45
select ARCH_HAS_DMA_COHERENT_TO_PFN if MMU
56
select ARCH_HAS_GCOV_PROFILE_ALL

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config MIPS
33
bool
44
default y
5+
select ARCH_32BIT_OFF_T if !64BIT
56
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
67
select ARCH_CLOCKSOURCE_DATA
78
select ARCH_DISCARD_MEMBLOCK

arch/nds32/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
config NDS32
77
def_bool y
8+
select ARCH_32BIT_OFF_T
89
select ARCH_HAS_SYNC_DMA_FOR_CPU
910
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
1011
select ARCH_WANT_FRAME_POINTERS if FTRACE

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#define __ARCH_WANT_STAT64
55
#define __ARCH_WANT_SYNC_FILE_RANGE2
6+
#define __ARCH_WANT_SET_GET_RLIMIT
7+
#define __ARCH_WANT_TIME32_SYSCALLS
68

79
/* Use the standard ABI for syscalls */
810
#include <asm-generic/unistd.h>

arch/nios2/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config NIOS2
33
def_bool y
4+
select ARCH_32BIT_OFF_T
45
select ARCH_HAS_SYNC_DMA_FOR_CPU
56
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
67
select ARCH_NO_SWAP

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#define __ARCH_WANT_RENAMEAT
2222
#define __ARCH_WANT_STAT64
23+
#define __ARCH_WANT_SET_GET_RLIMIT
24+
#define __ARCH_WANT_TIME32_SYSCALLS
2325

2426
/* Use the standard ABI for syscalls */
2527
#include <asm-generic/unistd.h>

arch/openrisc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
config OPENRISC
88
def_bool y
9+
select ARCH_32BIT_OFF_T
910
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
1011
select OF
1112
select OF_EARLY_FLATTREE

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121

2222
#define __ARCH_WANT_RENAMEAT
2323
#define __ARCH_WANT_STAT64
24+
#define __ARCH_WANT_SET_GET_RLIMIT
2425
#define __ARCH_WANT_SYS_FORK
2526
#define __ARCH_WANT_SYS_CLONE
27+
#define __ARCH_WANT_TIME32_SYSCALLS
2628

2729
#include <asm-generic/unistd.h>
2830

arch/parisc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config PARISC
33
def_bool y
4+
select ARCH_32BIT_OFF_T if !64BIT
45
select ARCH_MIGHT_HAVE_PC_PARPORT
56
select HAVE_IDE
67
select HAVE_OPROFILE

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ config PPC
128128
#
129129
# Please keep this list sorted alphabetically.
130130
#
131+
select ARCH_32BIT_OFF_T if PPC32
131132
select ARCH_HAS_DEBUG_VIRTUAL
132133
select ARCH_HAS_DEVMEM_IS_ALLOWED
133134
select ARCH_HAS_DMA_SET_COHERENT_MASK

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#ifdef __LP64__
1919
#define __ARCH_WANT_NEW_STAT
20+
#define __ARCH_WANT_SET_GET_RLIMIT
2021
#endif /* __LP64__ */
2122

2223
#include <asm-generic/unistd.h>

arch/riscv/kernel/vdso/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
# Symbols present in the vdso
44
vdso-syms = rt_sigreturn
5+
ifdef CONFIG_64BIT
56
vdso-syms += gettimeofday
67
vdso-syms += clock_gettime
78
vdso-syms += clock_getres
9+
endif
810
vdso-syms += getcpu
911
vdso-syms += flush_icache
1012

arch/sh/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ config SUPERH
6262

6363
config SUPERH32
6464
def_bool "$(ARCH)" = "sh"
65+
select ARCH_32BIT_OFF_T
6566
select HAVE_KPROBES
6667
select HAVE_KRETPROBES
6768
select HAVE_IOREMAP_PROT if MMU && !X2TLB

arch/sparc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ config SPARC
4949

5050
config SPARC32
5151
def_bool !64BIT
52+
select ARCH_32BIT_OFF_T
5253
select ARCH_HAS_SYNC_DMA_FOR_CPU
5354
select GENERIC_ATOMIC64
5455
select CLZ_TAB

arch/unicore32/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config UNICORE32
33
def_bool y
4+
select ARCH_32BIT_OFF_T
45
select ARCH_HAS_DEVMEM_IS_ALLOWED
56
select ARCH_MIGHT_HAVE_PC_PARPORT
67
select ARCH_MIGHT_HAVE_PC_SERIO

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
*/
1313

1414
#define __ARCH_WANT_RENAMEAT
15+
#define __ARCH_WANT_SET_GET_RLIMIT
16+
#define __ARCH_WANT_STAT64
17+
#define __ARCH_WANT_TIME32_SYSCALLS
1518

1619
/* Use the standard ABI for syscalls. */
1720
#include <asm-generic/unistd.h>
18-
#define __ARCH_WANT_STAT64
1921
#define __ARCH_WANT_SYS_CLONE

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ config X86
4747
select ACPI_LEGACY_TABLES_LOOKUP if ACPI
4848
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
4949
select ANON_INODES
50+
select ARCH_32BIT_OFF_T if X86_32
5051
select ARCH_CLOCKSOURCE_DATA
5152
select ARCH_CLOCKSOURCE_INIT
5253
select ARCH_DISCARD_MEMBLOCK

arch/x86/um/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config 64BIT
1717
config X86_32
1818
def_bool !64BIT
1919
select HAVE_AOUT
20+
select ARCH_32BIT_OFF_T
2021
select ARCH_WANT_IPC_PARSE_VERSION
2122
select MODULES_USE_ELF_REL
2223
select CLONE_BACKWARDS

arch/xtensa/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config XTENSA
33
def_bool y
4+
select ARCH_32BIT_OFF_T
45
select ARCH_HAS_SYNC_DMA_FOR_CPU
56
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
67
select ARCH_NO_COHERENT_DMA_MMAP if !MMU

include/linux/fcntl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE)
1313

1414
#ifndef force_o_largefile
15-
#define force_o_largefile() (BITS_PER_LONG != 32)
15+
#define force_o_largefile() (!IS_ENABLED(CONFIG_ARCH_32BIT_OFF_T))
1616
#endif
1717

1818
#if BITS_PER_LONG == 32

0 commit comments

Comments
 (0)