diff options
author | Deepa Dinamani <deepa.kernel@gmail.com> | 2017-08-02 19:51:12 -0700 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-09-03 20:21:24 -0400 |
commit | 50578ea97a2a352c109bd1657e667b212faf2cbb (patch) | |
tree | 7a242252edae5c64837daa28d9d008b18c2b445c /ipc | |
parent | b9047726386bb538cf5e4f52a9f04eb556eebc67 (diff) | |
download | linux-50578ea97a2a352c109bd1657e667b212faf2cbb.tar.gz linux-50578ea97a2a352c109bd1657e667b212faf2cbb.tar.bz2 linux-50578ea97a2a352c109bd1657e667b212faf2cbb.zip |
ipc: msg: Make msg_queue timestamps y2038 safe
time_t is not y2038 safe. Replace all uses of
time_t by y2038 safe time64_t.
Similarly, replace the calls to get_seconds() with
y2038 safe ktime_get_real_seconds().
Note that this preserves fast access on 64 bit systems,
but 32 bit systems need sequence counters.
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>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/msg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ipc/msg.c b/ipc/msg.c index 855da19c765a..0e7ccfc0700b 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -133,7 +133,7 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) } msq->q_stime = msq->q_rtime = 0; - msq->q_ctime = get_seconds(); + msq->q_ctime = ktime_get_real_seconds(); msq->q_cbytes = msq->q_qnum = 0; msq->q_qbytes = ns->msg_ctlmnb; msq->q_lspid = msq->q_lrpid = 0; @@ -406,7 +406,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, msq->q_qbytes = msqid64->msg_qbytes; - msq->q_ctime = get_seconds(); + msq->q_ctime = ktime_get_real_seconds(); /* * Sleeping receivers might be excluded by * stricter permissions. @@ -1181,7 +1181,7 @@ static int sysvipc_msg_proc_show(struct seq_file *s, void *it) struct msg_queue *msq = it; seq_printf(s, - "%10d %10d %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n", + "%10d %10d %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10llu %10llu %10llu\n", msq->q_perm.key, msq->q_perm.id, msq->q_perm.mode, |