summaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2017-05-02 10:16:05 -0400
committerPaul Moore <paul@paul-moore.com>2017-05-02 10:16:05 -0400
commit2115bb250f260089743e26decfb5f271ba71ca37 (patch)
tree22afee3acdbeb961ba4f27d27dde409578e3ae88 /kernel/auditsc.c
parentb6c7c115c2ce679ac536f0adf0ff518fcd939196 (diff)
audit: Use timespec64 to represent audit timestamps
struct timespec is not y2038 safe. Audit timestamps are recorded in string format into an audit buffer for a given context. These mark the entry timestamps for the syscalls. Use y2038 safe struct timespec64 to represent the times. The log strings can handle this transition as strings can hold upto 1024 characters. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Paul Moore <paul@paul-moore.com> Acked-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 1c2333155893..b2dcbe637b7c 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1532,7 +1532,7 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,
1532 return; 1532 return;
1533 1533
1534 context->serial = 0; 1534 context->serial = 0;
1535 context->ctime = CURRENT_TIME; 1535 ktime_get_real_ts64(&context->ctime);
1536 context->in_syscall = 1; 1536 context->in_syscall = 1;
1537 context->current_state = state; 1537 context->current_state = state;
1538 context->ppid = 0; 1538 context->ppid = 0;
@@ -1941,13 +1941,13 @@ EXPORT_SYMBOL_GPL(__audit_inode_child);
1941/** 1941/**
1942 * auditsc_get_stamp - get local copies of audit_context values 1942 * auditsc_get_stamp - get local copies of audit_context values
1943 * @ctx: audit_context for the task 1943 * @ctx: audit_context for the task
1944 * @t: timespec to store time recorded in the audit_context 1944 * @t: timespec64 to store time recorded in the audit_context
1945 * @serial: serial value that is recorded in the audit_context 1945 * @serial: serial value that is recorded in the audit_context
1946 * 1946 *
1947 * Also sets the context as auditable. 1947 * Also sets the context as auditable.
1948 */ 1948 */
1949int auditsc_get_stamp(struct audit_context *ctx, 1949int auditsc_get_stamp(struct audit_context *ctx,
1950 struct timespec *t, unsigned int *serial) 1950 struct timespec64 *t, unsigned int *serial)
1951{ 1951{
1952 if (!ctx->in_syscall) 1952 if (!ctx->in_syscall)
1953 return 0; 1953 return 0;