aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/audit.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r--include/linux/audit.h61
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
89enum 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
101struct audit_ntp_val {
102 long long oldval, newval;
103};
104
105struct audit_ntp_data {
106 struct audit_ntp_val vals[AUDIT_NTP_NVALS];
107};
108#else
109struct audit_ntp_data {};
110#endif
111
89extern int is_audit_feature_set(int which); 112extern int is_audit_feature_set(int which);
90 113
91extern int __init audit_register_class(int class, unsigned *list); 114extern int __init audit_register_class(int class, unsigned *list);
@@ -366,6 +389,7 @@ extern void __audit_mmap_fd(int fd, int flags);
366extern void __audit_log_kern_module(char *name); 389extern void __audit_log_kern_module(char *name);
367extern void __audit_fanotify(unsigned int response); 390extern void __audit_fanotify(unsigned int response);
368extern void __audit_tk_injoffset(struct timespec64 offset); 391extern void __audit_tk_injoffset(struct timespec64 offset);
392extern void __audit_ntp_log(const struct audit_ntp_data *ad);
369 393
370static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) 394static 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
505static inline void audit_ntp_init(struct audit_ntp_data *ad)
506{
507 memset(ad, 0, sizeof(*ad));
508}
509
510static 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
516static 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
522static inline void audit_ntp_log(const struct audit_ntp_data *ad)
523{
524 if (!audit_dummy_context())
525 __audit_ntp_log(ad);
526}
527
481extern int audit_n_rules; 528extern int audit_n_rules;
482extern int audit_signals; 529extern int audit_signals;
483#else /* CONFIG_AUDITSYSCALL */ 530#else /* CONFIG_AUDITSYSCALL */
@@ -594,6 +641,20 @@ static inline void audit_fanotify(unsigned int response)
594static inline void audit_tk_injoffset(struct timespec64 offset) 641static inline void audit_tk_injoffset(struct timespec64 offset)
595{ } 642{ }
596 643
644static inline void audit_ntp_init(struct audit_ntp_data *ad)
645{ }
646
647static inline void audit_ntp_set_old(struct audit_ntp_data *ad,
648 enum audit_ntp_type type, long long val)
649{ }
650
651static inline void audit_ntp_set_new(struct audit_ntp_data *ad,
652 enum audit_ntp_type type, long long val)
653{ }
654
655static inline void audit_ntp_log(const struct audit_ntp_data *ad)
656{ }
657
597static inline void audit_ptrace(struct task_struct *t) 658static inline void audit_ptrace(struct task_struct *t)
598{ } 659{ }
599#define audit_n_rules 0 660#define audit_n_rules 0