Skip to content

Commit 290e44b

Browse files
committed
audit: use ktime_get_coarse_real_ts64() for timestamps
Commit c72051d ("audit: use ktime_get_coarse_ts64() for time access") converted audit's use of current_kernel_time64() to the new ktime_get_coarse_ts64() function. Unfortunately this resulted in incorrect timestamps, e.g. events stamped with the year 1969 despite it being 2018. This patch corrects this by using ktime_get_coarse_real_ts64() just like the current_kernel_time64() wrapper. Fixes: c72051d ("audit: use ktime_get_coarse_ts64() for time access") Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent c72051d commit 290e44b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/audit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ static inline void audit_get_stamp(struct audit_context *ctx,
17211721
struct timespec64 *t, unsigned int *serial)
17221722
{
17231723
if (!ctx || !auditsc_get_stamp(ctx, t, serial)) {
1724-
ktime_get_coarse_ts64(t);
1724+
ktime_get_coarse_real_ts64(t);
17251725
*serial = audit_serial();
17261726
}
17271727
}

kernel/auditsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,
15431543
context->in_syscall = 1;
15441544
context->current_state = state;
15451545
context->ppid = 0;
1546-
ktime_get_coarse_ts64(&context->ctime);
1546+
ktime_get_coarse_real_ts64(&context->ctime);
15471547
}
15481548

15491549
/**

0 commit comments

Comments
 (0)