diff options
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r-- | include/linux/audit.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 2c62c0468888..43a23e28ba23 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -86,6 +86,29 @@ struct audit_field { | |||
86 | u32 op; | 86 | u32 op; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | enum audit_ntp_type { | ||
90 | AUDIT_NTP_OFFSET, | ||
91 | AUDIT_NTP_FREQ, | ||
92 | AUDIT_NTP_STATUS, | ||
93 | AUDIT_NTP_TAI, | ||
94 | AUDIT_NTP_TICK, | ||
95 | AUDIT_NTP_ADJUST, | ||
96 | |||
97 | AUDIT_NTP_NVALS /* count */ | ||
98 | }; | ||
99 | |||
100 | #ifdef CONFIG_AUDITSYSCALL | ||
101 | struct audit_ntp_val { | ||
102 | long long oldval, newval; | ||
103 | }; | ||
104 | |||
105 | struct audit_ntp_data { | ||
106 | struct audit_ntp_val vals[AUDIT_NTP_NVALS]; | ||
107 | }; | ||
108 | #else | ||
109 | struct audit_ntp_data {}; | ||
110 | #endif | ||
111 | |||
89 | extern int is_audit_feature_set(int which); | 112 | extern int is_audit_feature_set(int which); |
90 | 113 | ||
91 | extern int __init audit_register_class(int class, unsigned *list); | 114 | extern int __init audit_register_class(int class, unsigned *list); |
@@ -366,6 +389,7 @@ extern void __audit_mmap_fd(int fd, int flags); | |||
366 | extern void __audit_log_kern_module(char *name); | 389 | extern void __audit_log_kern_module(char *name); |
367 | extern void __audit_fanotify(unsigned int response); | 390 | extern void __audit_fanotify(unsigned int response); |
368 | extern void __audit_tk_injoffset(struct timespec64 offset); | 391 | extern void __audit_tk_injoffset(struct timespec64 offset); |
392 | extern void __audit_ntp_log(const struct audit_ntp_data *ad); | ||
369 | 393 | ||
370 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | 394 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
371 | { | 395 | { |
@@ -478,6 +502,29 @@ static inline void audit_tk_injoffset(struct timespec64 offset) | |||
478 | __audit_tk_injoffset(offset); | 502 | __audit_tk_injoffset(offset); |
479 | } | 503 | } |
480 | 504 | ||
505 | static inline void audit_ntp_init(struct audit_ntp_data *ad) | ||
506 | { | ||
507 | memset(ad, 0, sizeof(*ad)); | ||
508 | } | ||
509 | |||
510 | static inline void audit_ntp_set_old(struct audit_ntp_data *ad, | ||
511 | enum audit_ntp_type type, long long val) | ||
512 | { | ||
513 | ad->vals[type].oldval = val; | ||
514 | } | ||
515 | |||
516 | static inline void audit_ntp_set_new(struct audit_ntp_data *ad, | ||
517 | enum audit_ntp_type type, long long val) | ||
518 | { | ||
519 | ad->vals[type].newval = val; | ||
520 | } | ||
521 | |||
522 | static inline void audit_ntp_log(const struct audit_ntp_data *ad) | ||
523 | { | ||
524 | if (!audit_dummy_context()) | ||
525 | __audit_ntp_log(ad); | ||
526 | } | ||
527 | |||
481 | extern int audit_n_rules; | 528 | extern int audit_n_rules; |
482 | extern int audit_signals; | 529 | extern int audit_signals; |
483 | #else /* CONFIG_AUDITSYSCALL */ | 530 | #else /* CONFIG_AUDITSYSCALL */ |
@@ -594,6 +641,20 @@ static inline void audit_fanotify(unsigned int response) | |||
594 | static inline void audit_tk_injoffset(struct timespec64 offset) | 641 | static inline void audit_tk_injoffset(struct timespec64 offset) |
595 | { } | 642 | { } |
596 | 643 | ||
644 | static inline void audit_ntp_init(struct audit_ntp_data *ad) | ||
645 | { } | ||
646 | |||
647 | static inline void audit_ntp_set_old(struct audit_ntp_data *ad, | ||
648 | enum audit_ntp_type type, long long val) | ||
649 | { } | ||
650 | |||
651 | static inline void audit_ntp_set_new(struct audit_ntp_data *ad, | ||
652 | enum audit_ntp_type type, long long val) | ||
653 | { } | ||
654 | |||
655 | static inline void audit_ntp_log(const struct audit_ntp_data *ad) | ||
656 | { } | ||
657 | |||
597 | static inline void audit_ptrace(struct task_struct *t) | 658 | static inline void audit_ptrace(struct task_struct *t) |
598 | { } | 659 | { } |
599 | #define audit_n_rules 0 | 660 | #define audit_n_rules 0 |