diff options
-rw-r--r-- | include/linux/audit.h | 6 | ||||
-rw-r--r-- | ipc/mqueue.c | 28 | ||||
-rw-r--r-- | kernel/audit.h | 2 | ||||
-rw-r--r-- | kernel/auditsc.c | 12 |
4 files changed, 24 insertions, 24 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/ipc/mqueue.c b/ipc/mqueue.c index eb1391b52c6f..d24025626310 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -668,11 +668,11 @@ static void __do_notify(struct mqueue_inode_info *info) | |||
668 | } | 668 | } |
669 | 669 | ||
670 | static int prepare_timeout(const struct timespec __user *u_abs_timeout, | 670 | static int prepare_timeout(const struct timespec __user *u_abs_timeout, |
671 | struct timespec *ts) | 671 | struct timespec64 *ts) |
672 | { | 672 | { |
673 | if (copy_from_user(ts, u_abs_timeout, sizeof(struct timespec))) | 673 | if (get_timespec64(ts, u_abs_timeout)) |
674 | return -EFAULT; | 674 | return -EFAULT; |
675 | if (!timespec_valid(ts)) | 675 | if (!timespec64_valid(ts)) |
676 | return -EINVAL; | 676 | return -EINVAL; |
677 | return 0; | 677 | return 0; |
678 | } | 678 | } |
@@ -962,7 +962,7 @@ static inline void pipelined_receive(struct wake_q_head *wake_q, | |||
962 | 962 | ||
963 | static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, | 963 | static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, |
964 | size_t msg_len, unsigned int msg_prio, | 964 | size_t msg_len, unsigned int msg_prio, |
965 | struct timespec *ts) | 965 | struct timespec64 *ts) |
966 | { | 966 | { |
967 | struct fd f; | 967 | struct fd f; |
968 | struct inode *inode; | 968 | struct inode *inode; |
@@ -979,7 +979,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, | |||
979 | return -EINVAL; | 979 | return -EINVAL; |
980 | 980 | ||
981 | if (ts) { | 981 | if (ts) { |
982 | expires = timespec_to_ktime(*ts); | 982 | expires = timespec64_to_ktime(*ts); |
983 | timeout = &expires; | 983 | timeout = &expires; |
984 | } | 984 | } |
985 | 985 | ||
@@ -1080,7 +1080,7 @@ out: | |||
1080 | 1080 | ||
1081 | static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, | 1081 | static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, |
1082 | size_t msg_len, unsigned int __user *u_msg_prio, | 1082 | size_t msg_len, unsigned int __user *u_msg_prio, |
1083 | struct timespec *ts) | 1083 | struct timespec64 *ts) |
1084 | { | 1084 | { |
1085 | ssize_t ret; | 1085 | ssize_t ret; |
1086 | struct msg_msg *msg_ptr; | 1086 | struct msg_msg *msg_ptr; |
@@ -1092,7 +1092,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, | |||
1092 | struct posix_msg_tree_node *new_leaf = NULL; | 1092 | struct posix_msg_tree_node *new_leaf = NULL; |
1093 | 1093 | ||
1094 | if (ts) { | 1094 | if (ts) { |
1095 | expires = timespec_to_ktime(*ts); | 1095 | expires = timespec64_to_ktime(*ts); |
1096 | timeout = &expires; | 1096 | timeout = &expires; |
1097 | } | 1097 | } |
1098 | 1098 | ||
@@ -1184,7 +1184,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, | |||
1184 | size_t, msg_len, unsigned int, msg_prio, | 1184 | size_t, msg_len, unsigned int, msg_prio, |
1185 | const struct timespec __user *, u_abs_timeout) | 1185 | const struct timespec __user *, u_abs_timeout) |
1186 | { | 1186 | { |
1187 | struct timespec ts, *p = NULL; | 1187 | struct timespec64 ts, *p = NULL; |
1188 | if (u_abs_timeout) { | 1188 | if (u_abs_timeout) { |
1189 | int res = prepare_timeout(u_abs_timeout, &ts); | 1189 | int res = prepare_timeout(u_abs_timeout, &ts); |
1190 | if (res) | 1190 | if (res) |
@@ -1198,7 +1198,7 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, | |||
1198 | size_t, msg_len, unsigned int __user *, u_msg_prio, | 1198 | size_t, msg_len, unsigned int __user *, u_msg_prio, |
1199 | const struct timespec __user *, u_abs_timeout) | 1199 | const struct timespec __user *, u_abs_timeout) |
1200 | { | 1200 | { |
1201 | struct timespec ts, *p = NULL; | 1201 | struct timespec64 ts, *p = NULL; |
1202 | if (u_abs_timeout) { | 1202 | if (u_abs_timeout) { |
1203 | int res = prepare_timeout(u_abs_timeout, &ts); | 1203 | int res = prepare_timeout(u_abs_timeout, &ts); |
1204 | if (res) | 1204 | if (res) |
@@ -1475,11 +1475,11 @@ COMPAT_SYSCALL_DEFINE4(mq_open, const char __user *, u_name, | |||
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | static int compat_prepare_timeout(const struct compat_timespec __user *p, | 1477 | static int compat_prepare_timeout(const struct compat_timespec __user *p, |
1478 | struct timespec *ts) | 1478 | struct timespec64 *ts) |
1479 | { | 1479 | { |
1480 | if (compat_get_timespec(ts, p)) | 1480 | if (compat_get_timespec64(ts, p)) |
1481 | return -EFAULT; | 1481 | return -EFAULT; |
1482 | if (!timespec_valid(ts)) | 1482 | if (!timespec64_valid(ts)) |
1483 | return -EINVAL; | 1483 | return -EINVAL; |
1484 | return 0; | 1484 | return 0; |
1485 | } | 1485 | } |
@@ -1489,7 +1489,7 @@ COMPAT_SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, | |||
1489 | compat_size_t, msg_len, unsigned int, msg_prio, | 1489 | compat_size_t, msg_len, unsigned int, msg_prio, |
1490 | const struct compat_timespec __user *, u_abs_timeout) | 1490 | const struct compat_timespec __user *, u_abs_timeout) |
1491 | { | 1491 | { |
1492 | struct timespec ts, *p = NULL; | 1492 | struct timespec64 ts, *p = NULL; |
1493 | if (u_abs_timeout) { | 1493 | if (u_abs_timeout) { |
1494 | int res = compat_prepare_timeout(u_abs_timeout, &ts); | 1494 | int res = compat_prepare_timeout(u_abs_timeout, &ts); |
1495 | if (res) | 1495 | if (res) |
@@ -1504,7 +1504,7 @@ COMPAT_SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, | |||
1504 | compat_size_t, msg_len, unsigned int __user *, u_msg_prio, | 1504 | compat_size_t, msg_len, unsigned int __user *, u_msg_prio, |
1505 | const struct compat_timespec __user *, u_abs_timeout) | 1505 | const struct compat_timespec __user *, u_abs_timeout) |
1506 | { | 1506 | { |
1507 | struct timespec ts, *p = NULL; | 1507 | struct timespec64 ts, *p = NULL; |
1508 | if (u_abs_timeout) { | 1508 | if (u_abs_timeout) { |
1509 | int res = compat_prepare_timeout(u_abs_timeout, &ts); | 1509 | int res = compat_prepare_timeout(u_abs_timeout, &ts); |
1510 | if (res) | 1510 | if (res) |
diff --git a/kernel/audit.h b/kernel/audit.h index b331d9b83f63..9b110ae17ee3 100644 --- a/kernel/audit.h +++ b/kernel/audit.h | |||
@@ -182,7 +182,7 @@ struct audit_context { | |||
182 | mqd_t mqdes; | 182 | mqd_t mqdes; |
183 | size_t msg_len; | 183 | size_t msg_len; |
184 | unsigned int msg_prio; | 184 | unsigned int msg_prio; |
185 | struct timespec abs_timeout; | 185 | struct timespec64 abs_timeout; |
186 | } mq_sendrecv; | 186 | } mq_sendrecv; |
187 | struct { | 187 | struct { |
188 | int oflag; | 188 | int oflag; |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 3260ba2312a9..daee2d5bd03a 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1235,11 +1235,11 @@ static void show_special(struct audit_context *context, int *call_panic) | |||
1235 | case AUDIT_MQ_SENDRECV: | 1235 | case AUDIT_MQ_SENDRECV: |
1236 | audit_log_format(ab, | 1236 | audit_log_format(ab, |
1237 | "mqdes=%d msg_len=%zd msg_prio=%u " | 1237 | "mqdes=%d msg_len=%zd msg_prio=%u " |
1238 | "abs_timeout_sec=%ld abs_timeout_nsec=%ld", | 1238 | "abs_timeout_sec=%lld abs_timeout_nsec=%ld", |
1239 | context->mq_sendrecv.mqdes, | 1239 | context->mq_sendrecv.mqdes, |
1240 | context->mq_sendrecv.msg_len, | 1240 | context->mq_sendrecv.msg_len, |
1241 | context->mq_sendrecv.msg_prio, | 1241 | context->mq_sendrecv.msg_prio, |
1242 | context->mq_sendrecv.abs_timeout.tv_sec, | 1242 | (long long) context->mq_sendrecv.abs_timeout.tv_sec, |
1243 | context->mq_sendrecv.abs_timeout.tv_nsec); | 1243 | context->mq_sendrecv.abs_timeout.tv_nsec); |
1244 | break; | 1244 | break; |
1245 | case AUDIT_MQ_NOTIFY: | 1245 | case AUDIT_MQ_NOTIFY: |
@@ -2083,15 +2083,15 @@ void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) | |||
2083 | * | 2083 | * |
2084 | */ | 2084 | */ |
2085 | void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, | 2085 | void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, |
2086 | const struct timespec *abs_timeout) | 2086 | const struct timespec64 *abs_timeout) |
2087 | { | 2087 | { |
2088 | struct audit_context *context = current->audit_context; | 2088 | struct audit_context *context = current->audit_context; |
2089 | struct timespec *p = &context->mq_sendrecv.abs_timeout; | 2089 | struct timespec64 *p = &context->mq_sendrecv.abs_timeout; |
2090 | 2090 | ||
2091 | if (abs_timeout) | 2091 | if (abs_timeout) |
2092 | memcpy(p, abs_timeout, sizeof(struct timespec)); | 2092 | memcpy(p, abs_timeout, sizeof(*p)); |
2093 | else | 2093 | else |
2094 | memset(p, 0, sizeof(struct timespec)); | 2094 | memset(p, 0, sizeof(*p)); |
2095 | 2095 | ||
2096 | context->mq_sendrecv.mqdes = mqdes; | 2096 | context->mq_sendrecv.mqdes = mqdes; |
2097 | context->mq_sendrecv.msg_len = msg_len; | 2097 | context->mq_sendrecv.msg_len = msg_len; |