summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2017-08-02 22:51:11 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-09-03 20:21:24 -0400
commitb9047726386bb538cf5e4f52a9f04eb556eebc67 (patch)
tree3cb2982a68670faacb4e6032c5a9c377f33db8d8 /kernel
parent3ef56dc2678258b7211b1870d034c1666becb2bd (diff)
ipc: mqueue: Replace timespec with timespec64
struct timespec is not y2038 safe. Replace all uses of timespec by y2038 safe struct timespec64. Even though timespec is used here to represent timeouts, replace these with timespec64 so that it facilitates in verification by creating a y2038 safe kernel image that is free of timespec. The syscall interfaces themselves are not changed as part of the patch. They will be part of a different series. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Cc: Paul Moore <paul@paul-moore.com> Cc: Richard Guy Briggs <rgb@redhat.com> Reviewed-by: Richard Guy Briggs <rgb@redhat.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.h2
-rw-r--r--kernel/auditsc.c12
2 files changed, 7 insertions, 7 deletions
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 */
2085void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, 2085void __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;