Skip to content

Commit

Permalink
Merge tag 'y2038-ipc' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/arnd/playground into timers/2038

Pull 'y2038: IPC system call conversion' from Arnd Bergmann:

"This is a follow-up to Deepa's work on the timekeeping system calls,
 providing a y2038-safe syscall API for SYSVIPC. It uses a combination
 of two strategies:

 For sys_msgctl, sys_semctl and sys_shmctl, I do not introduce a completely
 new set of replacement system calls, but instead extend the existing
 ones to return data in the reserved fields of the normal data structure.

 This should be completely transparent to any existing user space, and
 only after the 32-bit time_t wraps, it will make a difference in the
 returned data.

 libc implementations will consequently have to provide their own data
 structures when they move to 64-bit time_t, and convert the structures
 in user space from the ones returned by the kernel.

 In contrast, mq_timedsend, mq_timedreceive and and semtimedop all do
 need to change because having a libc redefine the timespec type
 breaks the ABI, so with this series there will be two separate entry
 points for 32-bit architectures.

 There are three cases here:

 - little-endian architectures (except powerpc and mips) can use
   the normal layout and just cast the data structure to the user space
   type that contains 64-bit numbers.

 - parisc and sparc can do the same thing with big-endian user space

 - little-endian powerpc and most big-endian architectures have
   to flip the upper and lower 32-bit halves of the time_t value in memory,
   but can otherwise keep using the normal layout

 - mips and big-endian xtensa need to be more careful because
   they are not consistent in their definitions, and they have to provide
   custom libc implementations for the system calls to use 64-bit time_t."
  • Loading branch information
Thomas Gleixner committed May 7, 2018
2 parents 1cfd904 + 5dc0b15 commit 4fe581d
Show file tree
Hide file tree
Showing 47 changed files with 471 additions and 700 deletions.
4 changes: 4 additions & 0 deletions arch/alpha/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += bpf_perf_event.h
generic-y += ipcbuf.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += sembuf.h
generic-y += shmbuf.h
2 changes: 0 additions & 2 deletions arch/alpha/include/uapi/asm/ipcbuf.h

This file was deleted.

28 changes: 0 additions & 28 deletions arch/alpha/include/uapi/asm/msgbuf.h

This file was deleted.

23 changes: 0 additions & 23 deletions arch/alpha/include/uapi/asm/sembuf.h

This file was deleted.

39 changes: 0 additions & 39 deletions arch/alpha/include/uapi/asm/shmbuf.h

This file was deleted.

32 changes: 16 additions & 16 deletions arch/arm64/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,23 @@ struct compat_ipc64_perm {

struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
compat_time_t sem_otime;
compat_ulong_t __unused1;
compat_time_t sem_ctime;
compat_ulong_t __unused2;
compat_ulong_t sem_otime;
compat_ulong_t sem_otime_high;
compat_ulong_t sem_ctime;
compat_ulong_t sem_ctime_high;
compat_ulong_t sem_nsems;
compat_ulong_t __unused3;
compat_ulong_t __unused4;
};

struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
compat_time_t msg_stime;
compat_ulong_t __unused1;
compat_time_t msg_rtime;
compat_ulong_t __unused2;
compat_time_t msg_ctime;
compat_ulong_t __unused3;
compat_ulong_t msg_stime;
compat_ulong_t msg_stime_high;
compat_ulong_t msg_rtime;
compat_ulong_t msg_rtime_high;
compat_ulong_t msg_ctime;
compat_ulong_t msg_ctime_high;
compat_ulong_t msg_cbytes;
compat_ulong_t msg_qnum;
compat_ulong_t msg_qbytes;
Expand All @@ -210,12 +210,12 @@ struct compat_msqid64_ds {
struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
compat_size_t shm_segsz;
compat_time_t shm_atime;
compat_ulong_t __unused1;
compat_time_t shm_dtime;
compat_ulong_t __unused2;
compat_time_t shm_ctime;
compat_ulong_t __unused3;
compat_ulong_t shm_atime;
compat_ulong_t shm_atime_high;
compat_ulong_t shm_dtime;
compat_ulong_t shm_dtime_high;
compat_ulong_t shm_ctime;
compat_ulong_t shm_ctime_high;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
compat_ulong_t shm_nattch;
Expand Down
4 changes: 4 additions & 0 deletions arch/ia64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += bpf_perf_event.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += sembuf.h
generic-y += shmbuf.h
2 changes: 0 additions & 2 deletions arch/ia64/include/uapi/asm/ipcbuf.h

This file was deleted.

28 changes: 0 additions & 28 deletions arch/ia64/include/uapi/asm/msgbuf.h

This file was deleted.

23 changes: 0 additions & 23 deletions arch/ia64/include/uapi/asm/sembuf.h

This file was deleted.

39 changes: 0 additions & 39 deletions arch/ia64/include/uapi/asm/shmbuf.h

This file was deleted.

40 changes: 22 additions & 18 deletions arch/mips/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ typedef struct {
typedef s32 compat_timer_t;
typedef s32 compat_key_t;

typedef s16 compat_short_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64;
typedef u16 compat_ushort_t;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64;
Expand Down Expand Up @@ -157,35 +159,35 @@ struct compat_ipc64_perm {

struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
compat_time_t sem_otime;
compat_time_t sem_ctime;
compat_ulong_t sem_otime;
compat_ulong_t sem_ctime;
compat_ulong_t sem_nsems;
compat_ulong_t __unused1;
compat_ulong_t __unused2;
compat_ulong_t sem_otime_high;
compat_ulong_t sem_ctime_high;
};

struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
#ifndef CONFIG_CPU_LITTLE_ENDIAN
compat_ulong_t __unused1;
compat_ulong_t msg_stime_high;
#endif
compat_time_t msg_stime;
compat_ulong_t msg_stime;
#ifdef CONFIG_CPU_LITTLE_ENDIAN
compat_ulong_t __unused1;
compat_ulong_t msg_stime_high;
#endif
#ifndef CONFIG_CPU_LITTLE_ENDIAN
compat_ulong_t __unused2;
compat_ulong_t msg_rtime_high;
#endif
compat_time_t msg_rtime;
compat_ulong_t msg_rtime;
#ifdef CONFIG_CPU_LITTLE_ENDIAN
compat_ulong_t __unused2;
compat_ulong_t msg_rtime_high;
#endif
#ifndef CONFIG_CPU_LITTLE_ENDIAN
compat_ulong_t __unused3;
compat_ulong_t msg_ctime_high;
#endif
compat_time_t msg_ctime;
compat_ulong_t msg_ctime;
#ifdef CONFIG_CPU_LITTLE_ENDIAN
compat_ulong_t __unused3;
compat_ulong_t msg_ctime_high;
#endif
compat_ulong_t msg_cbytes;
compat_ulong_t msg_qnum;
Expand All @@ -199,14 +201,16 @@ struct compat_msqid64_ds {
struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
compat_size_t shm_segsz;
compat_time_t shm_atime;
compat_time_t shm_dtime;
compat_time_t shm_ctime;
compat_ulong_t shm_atime;
compat_ulong_t shm_dtime;
compat_ulong_t shm_ctime;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
compat_ulong_t shm_nattch;
compat_ulong_t __unused1;
compat_ulong_t __unused2;
compat_ushort_t shm_atime_high;
compat_ushort_t shm_dtime_high;
compat_ushort_t shm_ctime_high;
compat_ushort_t __unused2;
};

/* MIPS has unusual order of fields in stack_t */
Expand Down
Loading

0 comments on commit 4fe581d

Please sign in to comment.