diff options
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 3843495d0083..5371b59bde36 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -2519,6 +2519,28 @@ void __audit_tk_injoffset(struct timespec64 offset) | |||
2519 | (long long)offset.tv_sec, offset.tv_nsec); | 2519 | (long long)offset.tv_sec, offset.tv_nsec); |
2520 | } | 2520 | } |
2521 | 2521 | ||
2522 | static void audit_log_ntp_val(const struct audit_ntp_data *ad, | ||
2523 | const char *op, enum audit_ntp_type type) | ||
2524 | { | ||
2525 | const struct audit_ntp_val *val = &ad->vals[type]; | ||
2526 | |||
2527 | if (val->newval == val->oldval) | ||
2528 | return; | ||
2529 | |||
2530 | audit_log(audit_context(), GFP_KERNEL, AUDIT_TIME_ADJNTPVAL, | ||
2531 | "op=%s old=%lli new=%lli", op, val->oldval, val->newval); | ||
2532 | } | ||
2533 | |||
2534 | void __audit_ntp_log(const struct audit_ntp_data *ad) | ||
2535 | { | ||
2536 | audit_log_ntp_val(ad, "offset", AUDIT_NTP_OFFSET); | ||
2537 | audit_log_ntp_val(ad, "freq", AUDIT_NTP_FREQ); | ||
2538 | audit_log_ntp_val(ad, "status", AUDIT_NTP_STATUS); | ||
2539 | audit_log_ntp_val(ad, "tai", AUDIT_NTP_TAI); | ||
2540 | audit_log_ntp_val(ad, "tick", AUDIT_NTP_TICK); | ||
2541 | audit_log_ntp_val(ad, "adjust", AUDIT_NTP_ADJUST); | ||
2542 | } | ||
2543 | |||
2522 | static void audit_log_task(struct audit_buffer *ab) | 2544 | static void audit_log_task(struct audit_buffer *ab) |
2523 | { | 2545 | { |
2524 | kuid_t auid, uid; | 2546 | kuid_t auid, uid; |