diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 20:37:26 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 20:37:26 -0400 |
| commit | cc73fee0bae2d66594d1fa2df92bbd783aa98e04 (patch) | |
| tree | d1e7fe7f76cae4cbc941fc3bb43a46d237a9df77 /include/linux | |
| parent | e7cdb60fd28b252f1c15a0e50f79a01906124915 (diff) | |
| parent | aaed2dd8a31359e5767ee099ecbb078d55be4d29 (diff) | |
Merge branch 'work.ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull ipc compat cleanup and 64-bit time_t from Al Viro:
"IPC copyin/copyout sanitizing, including 64bit time_t work from Deepa
Dinamani"
* 'work.ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
utimes: Make utimes y2038 safe
ipc: shm: Make shmid_kernel timestamps y2038 safe
ipc: sem: Make sem_array timestamps y2038 safe
ipc: msg: Make msg_queue timestamps y2038 safe
ipc: mqueue: Replace timespec with timespec64
ipc: Make sys_semtimedop() y2038 safe
get rid of SYSVIPC_COMPAT on ia64
semtimedop(): move compat to native
shmat(2): move compat to native
msgrcv(2), msgsnd(2): move compat to native
ipc(2): move compat to native
ipc: make use of compat ipc_perm helpers
semctl(): move compat to native
semctl(): separate all layout-dependent copyin/copyout
msgctl(): move compat to native
msgctl(): split the actual work from copyin/copyout
ipc: move compat shmctl to native
shmctl: split the work from copyin/copyout
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/audit.h | 6 | ||||
| -rw-r--r-- | include/linux/compat.h | 9 | ||||
| -rw-r--r-- | include/linux/msg.h | 15 | ||||
| -rw-r--r-- | include/linux/sem.h | 3 | ||||
| -rw-r--r-- | include/linux/shm.h | 6 | ||||
| -rw-r--r-- | include/linux/time.h | 2 |
6 files changed, 13 insertions, 28 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 2150bdccfbab..74d4d4e8e3db 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -351,7 +351,7 @@ extern int __audit_socketcall(int nargs, unsigned long *args); | |||
| 351 | extern int __audit_sockaddr(int len, void *addr); | 351 | extern int __audit_sockaddr(int len, void *addr); |
| 352 | extern void __audit_fd_pair(int fd1, int fd2); | 352 | extern void __audit_fd_pair(int fd1, int fd2); |
| 353 | extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); | 353 | extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); |
| 354 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); | 354 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec64 *abs_timeout); |
| 355 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); | 355 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); |
| 356 | extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | 356 | extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); |
| 357 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | 357 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, |
| @@ -412,7 +412,7 @@ static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) | |||
| 412 | if (unlikely(!audit_dummy_context())) | 412 | if (unlikely(!audit_dummy_context())) |
| 413 | __audit_mq_open(oflag, mode, attr); | 413 | __audit_mq_open(oflag, mode, attr); |
| 414 | } | 414 | } |
| 415 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout) | 415 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec64 *abs_timeout) |
| 416 | { | 416 | { |
| 417 | if (unlikely(!audit_dummy_context())) | 417 | if (unlikely(!audit_dummy_context())) |
| 418 | __audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout); | 418 | __audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout); |
| @@ -549,7 +549,7 @@ static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) | |||
| 549 | { } | 549 | { } |
| 550 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, | 550 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, |
| 551 | unsigned int msg_prio, | 551 | unsigned int msg_prio, |
| 552 | const struct timespec *abs_timeout) | 552 | const struct timespec64 *abs_timeout) |
| 553 | { } | 553 | { } |
| 554 | static inline void audit_mq_notify(mqd_t mqdes, | 554 | static inline void audit_mq_notify(mqd_t mqdes, |
| 555 | const struct sigevent *notification) | 555 | const struct sigevent *notification) |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 3fc433303d7a..a5619de3437d 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -171,15 +171,6 @@ extern int get_compat_itimerspec64(struct itimerspec64 *its, | |||
| 171 | extern int put_compat_itimerspec64(const struct itimerspec64 *its, | 171 | extern int put_compat_itimerspec64(const struct itimerspec64 *its, |
| 172 | struct compat_itimerspec __user *uits); | 172 | struct compat_itimerspec __user *uits); |
| 173 | 173 | ||
| 174 | /* | ||
| 175 | * This function convert a timespec if necessary and returns a *user | ||
| 176 | * space* pointer. If no conversion is necessary, it returns the | ||
| 177 | * initial pointer. NULL is a legitimate argument and will always | ||
| 178 | * output NULL. | ||
| 179 | */ | ||
| 180 | extern int compat_convert_timespec(struct timespec __user **, | ||
| 181 | const void __user *); | ||
| 182 | |||
| 183 | struct compat_iovec { | 174 | struct compat_iovec { |
| 184 | compat_uptr_t iov_base; | 175 | compat_uptr_t iov_base; |
| 185 | compat_size_t iov_len; | 176 | compat_size_t iov_len; |
diff --git a/include/linux/msg.h b/include/linux/msg.h index a001305f5a79..81263fe3f9dc 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_MSG_H | 2 | #define _LINUX_MSG_H |
| 3 | 3 | ||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/time64.h> | ||
| 5 | #include <uapi/linux/msg.h> | 6 | #include <uapi/linux/msg.h> |
| 6 | 7 | ||
| 7 | /* one msg_msg structure for each message */ | 8 | /* one msg_msg structure for each message */ |
| @@ -17,9 +18,9 @@ struct msg_msg { | |||
| 17 | /* one msq_queue structure for each present queue on the system */ | 18 | /* one msq_queue structure for each present queue on the system */ |
| 18 | struct msg_queue { | 19 | struct msg_queue { |
| 19 | struct kern_ipc_perm q_perm; | 20 | struct kern_ipc_perm q_perm; |
| 20 | time_t q_stime; /* last msgsnd time */ | 21 | time64_t q_stime; /* last msgsnd time */ |
| 21 | time_t q_rtime; /* last msgrcv time */ | 22 | time64_t q_rtime; /* last msgrcv time */ |
| 22 | time_t q_ctime; /* last change time */ | 23 | time64_t q_ctime; /* last change time */ |
| 23 | unsigned long q_cbytes; /* current number of bytes on queue */ | 24 | unsigned long q_cbytes; /* current number of bytes on queue */ |
| 24 | unsigned long q_qnum; /* number of messages in queue */ | 25 | unsigned long q_qnum; /* number of messages in queue */ |
| 25 | unsigned long q_qbytes; /* max number of bytes on queue */ | 26 | unsigned long q_qbytes; /* max number of bytes on queue */ |
| @@ -31,12 +32,4 @@ struct msg_queue { | |||
| 31 | struct list_head q_senders; | 32 | struct list_head q_senders; |
| 32 | } __randomize_layout; | 33 | } __randomize_layout; |
| 33 | 34 | ||
| 34 | /* Helper routines for sys_msgsnd and sys_msgrcv */ | ||
| 35 | extern long do_msgsnd(int msqid, long mtype, void __user *mtext, | ||
| 36 | size_t msgsz, int msgflg); | ||
| 37 | extern long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, | ||
| 38 | int msgflg, | ||
| 39 | long (*msg_fill)(void __user *, struct msg_msg *, | ||
| 40 | size_t)); | ||
| 41 | |||
| 42 | #endif /* _LINUX_MSG_H */ | 35 | #endif /* _LINUX_MSG_H */ |
diff --git a/include/linux/sem.h b/include/linux/sem.h index de2deb8676bd..0083128318f6 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/atomic.h> | 4 | #include <linux/atomic.h> |
| 5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
| 6 | #include <linux/cache.h> | 6 | #include <linux/cache.h> |
| 7 | #include <linux/time64.h> | ||
| 7 | #include <uapi/linux/sem.h> | 8 | #include <uapi/linux/sem.h> |
| 8 | 9 | ||
| 9 | struct task_struct; | 10 | struct task_struct; |
| @@ -30,7 +31,7 @@ struct sem { | |||
| 30 | /* One sem_array data structure for each set of semaphores in the system. */ | 31 | /* One sem_array data structure for each set of semaphores in the system. */ |
| 31 | struct sem_array { | 32 | struct sem_array { |
| 32 | struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ | 33 | struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ |
| 33 | time_t sem_ctime; /* create/last semctl() time */ | 34 | time64_t sem_ctime; /* create/last semctl() time */ |
| 34 | struct list_head pending_alter; /* pending operations */ | 35 | struct list_head pending_alter; /* pending operations */ |
| 35 | /* that alter the array */ | 36 | /* that alter the array */ |
| 36 | struct list_head pending_const; /* pending complex operations */ | 37 | struct list_head pending_const; /* pending complex operations */ |
diff --git a/include/linux/shm.h b/include/linux/shm.h index 21a5e6c43385..74a4b3b64352 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
| @@ -12,9 +12,9 @@ struct shmid_kernel /* private to the kernel */ | |||
| 12 | struct file *shm_file; | 12 | struct file *shm_file; |
| 13 | unsigned long shm_nattch; | 13 | unsigned long shm_nattch; |
| 14 | unsigned long shm_segsz; | 14 | unsigned long shm_segsz; |
| 15 | time_t shm_atim; | 15 | time64_t shm_atim; |
| 16 | time_t shm_dtim; | 16 | time64_t shm_dtim; |
| 17 | time_t shm_ctim; | 17 | time64_t shm_ctim; |
| 18 | pid_t shm_cprid; | 18 | pid_t shm_cprid; |
| 19 | pid_t shm_lprid; | 19 | pid_t shm_lprid; |
| 20 | struct user_struct *mlock_user; | 20 | struct user_struct *mlock_user; |
diff --git a/include/linux/time.h b/include/linux/time.h index 3877136bbdf8..9bc1f945777c 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -178,7 +178,7 @@ extern int do_setitimer(int which, struct itimerval *value, | |||
| 178 | struct itimerval *ovalue); | 178 | struct itimerval *ovalue); |
| 179 | extern int do_getitimer(int which, struct itimerval *value); | 179 | extern int do_getitimer(int which, struct itimerval *value); |
| 180 | 180 | ||
| 181 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); | 181 | extern long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, int flags); |
| 182 | 182 | ||
| 183 | /* | 183 | /* |
| 184 | * Similar to the struct tm in userspace <time.h>, but it needs to be here so | 184 | * Similar to the struct tm in userspace <time.h>, but it needs to be here so |
