xref: /linux-6.15/include/linux/audit.h (revision 5bd2182d)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* audit.h -- Auditing support
3  *
4  * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
5  * All Rights Reserved.
6  *
7  * Written by Rickard E. (Rik) Faith <[email protected]>
8  */
9 #ifndef _LINUX_AUDIT_H_
10 #define _LINUX_AUDIT_H_
11 
12 #include <linux/sched.h>
13 #include <linux/ptrace.h>
14 #include <uapi/linux/audit.h>
15 #include <uapi/linux/netfilter/nf_tables.h>
16 
17 #define AUDIT_INO_UNSET ((unsigned long)-1)
18 #define AUDIT_DEV_UNSET ((dev_t)-1)
19 
20 struct audit_sig_info {
21 	uid_t		uid;
22 	pid_t		pid;
23 	char		ctx[];
24 };
25 
26 struct audit_buffer;
27 struct audit_context;
28 struct inode;
29 struct netlink_skb_parms;
30 struct path;
31 struct linux_binprm;
32 struct mq_attr;
33 struct mqstat;
34 struct audit_watch;
35 struct audit_tree;
36 struct sk_buff;
37 
38 struct audit_krule {
39 	u32			pflags;
40 	u32			flags;
41 	u32			listnr;
42 	u32			action;
43 	u32			mask[AUDIT_BITMASK_SIZE];
44 	u32			buflen; /* for data alloc on list rules */
45 	u32			field_count;
46 	char			*filterkey; /* ties events to rules */
47 	struct audit_field	*fields;
48 	struct audit_field	*arch_f; /* quick access to arch field */
49 	struct audit_field	*inode_f; /* quick access to an inode field */
50 	struct audit_watch	*watch;	/* associated watch */
51 	struct audit_tree	*tree;	/* associated watched tree */
52 	struct audit_fsnotify_mark	*exe;
53 	struct list_head	rlist;	/* entry in audit_{watch,tree}.rules list */
54 	struct list_head	list;	/* for AUDIT_LIST* purposes only */
55 	u64			prio;
56 };
57 
58 /* Flag to indicate legacy AUDIT_LOGINUID unset usage */
59 #define AUDIT_LOGINUID_LEGACY		0x1
60 
61 struct audit_field {
62 	u32				type;
63 	union {
64 		u32			val;
65 		kuid_t			uid;
66 		kgid_t			gid;
67 		struct {
68 			char		*lsm_str;
69 			void		*lsm_rule;
70 		};
71 	};
72 	u32				op;
73 };
74 
75 enum audit_ntp_type {
76 	AUDIT_NTP_OFFSET,
77 	AUDIT_NTP_FREQ,
78 	AUDIT_NTP_STATUS,
79 	AUDIT_NTP_TAI,
80 	AUDIT_NTP_TICK,
81 	AUDIT_NTP_ADJUST,
82 
83 	AUDIT_NTP_NVALS /* count */
84 };
85 
86 #ifdef CONFIG_AUDITSYSCALL
87 struct audit_ntp_val {
88 	long long oldval, newval;
89 };
90 
91 struct audit_ntp_data {
92 	struct audit_ntp_val vals[AUDIT_NTP_NVALS];
93 };
94 #else
95 struct audit_ntp_data {};
96 #endif
97 
98 enum audit_nfcfgop {
99 	AUDIT_XT_OP_REGISTER,
100 	AUDIT_XT_OP_REPLACE,
101 	AUDIT_XT_OP_UNREGISTER,
102 	AUDIT_NFT_OP_TABLE_REGISTER,
103 	AUDIT_NFT_OP_TABLE_UNREGISTER,
104 	AUDIT_NFT_OP_CHAIN_REGISTER,
105 	AUDIT_NFT_OP_CHAIN_UNREGISTER,
106 	AUDIT_NFT_OP_RULE_REGISTER,
107 	AUDIT_NFT_OP_RULE_UNREGISTER,
108 	AUDIT_NFT_OP_SET_REGISTER,
109 	AUDIT_NFT_OP_SET_UNREGISTER,
110 	AUDIT_NFT_OP_SETELEM_REGISTER,
111 	AUDIT_NFT_OP_SETELEM_UNREGISTER,
112 	AUDIT_NFT_OP_GEN_REGISTER,
113 	AUDIT_NFT_OP_OBJ_REGISTER,
114 	AUDIT_NFT_OP_OBJ_UNREGISTER,
115 	AUDIT_NFT_OP_OBJ_RESET,
116 	AUDIT_NFT_OP_FLOWTABLE_REGISTER,
117 	AUDIT_NFT_OP_FLOWTABLE_UNREGISTER,
118 	AUDIT_NFT_OP_INVALID,
119 };
120 
121 extern int is_audit_feature_set(int which);
122 
123 extern int __init audit_register_class(int class, unsigned *list);
124 extern int audit_classify_syscall(int abi, unsigned syscall);
125 extern int audit_classify_arch(int arch);
126 /* only for compat system calls */
127 extern unsigned compat_write_class[];
128 extern unsigned compat_read_class[];
129 extern unsigned compat_dir_class[];
130 extern unsigned compat_chattr_class[];
131 extern unsigned compat_signal_class[];
132 
133 extern int audit_classify_compat_syscall(int abi, unsigned syscall);
134 
135 /* audit_names->type values */
136 #define	AUDIT_TYPE_UNKNOWN	0	/* we don't know yet */
137 #define	AUDIT_TYPE_NORMAL	1	/* a "normal" audit record */
138 #define	AUDIT_TYPE_PARENT	2	/* a parent audit record */
139 #define	AUDIT_TYPE_CHILD_DELETE 3	/* a child being deleted */
140 #define	AUDIT_TYPE_CHILD_CREATE 4	/* a child being created */
141 
142 /* maximized args number that audit_socketcall can process */
143 #define AUDITSC_ARGS		6
144 
145 /* bit values for ->signal->audit_tty */
146 #define AUDIT_TTY_ENABLE	BIT(0)
147 #define AUDIT_TTY_LOG_PASSWD	BIT(1)
148 
149 struct filename;
150 
151 #define AUDIT_OFF	0
152 #define AUDIT_ON	1
153 #define AUDIT_LOCKED	2
154 #ifdef CONFIG_AUDIT
155 /* These are defined in audit.c */
156 				/* Public API */
157 extern __printf(4, 5)
158 void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
159 	       const char *fmt, ...);
160 
161 extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
162 extern __printf(2, 3)
163 void audit_log_format(struct audit_buffer *ab, const char *fmt, ...);
164 extern void		    audit_log_end(struct audit_buffer *ab);
165 extern bool		    audit_string_contains_control(const char *string,
166 							  size_t len);
167 extern void		    audit_log_n_hex(struct audit_buffer *ab,
168 					  const unsigned char *buf,
169 					  size_t len);
170 extern void		    audit_log_n_string(struct audit_buffer *ab,
171 					       const char *buf,
172 					       size_t n);
173 extern void		    audit_log_n_untrustedstring(struct audit_buffer *ab,
174 							const char *string,
175 							size_t n);
176 extern void		    audit_log_untrustedstring(struct audit_buffer *ab,
177 						      const char *string);
178 extern void		    audit_log_d_path(struct audit_buffer *ab,
179 					     const char *prefix,
180 					     const struct path *path);
181 extern void		    audit_log_key(struct audit_buffer *ab,
182 					  char *key);
183 extern void		    audit_log_path_denied(int type,
184 						  const char *operation);
185 extern void		    audit_log_lost(const char *message);
186 
187 extern int audit_log_task_context(struct audit_buffer *ab);
188 extern void audit_log_task_info(struct audit_buffer *ab);
189 
190 extern int		    audit_update_lsm_rules(void);
191 
192 				/* Private API (for audit.c only) */
193 extern int audit_rule_change(int type, int seq, void *data, size_t datasz);
194 extern int audit_list_rules_send(struct sk_buff *request_skb, int seq);
195 
196 extern int audit_set_loginuid(kuid_t loginuid);
197 
198 static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
199 {
200 	return tsk->loginuid;
201 }
202 
203 static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
204 {
205 	return tsk->sessionid;
206 }
207 
208 extern u32 audit_enabled;
209 
210 extern int audit_signal_info(int sig, struct task_struct *t);
211 
212 #else /* CONFIG_AUDIT */
213 static inline __printf(4, 5)
214 void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
215 	       const char *fmt, ...)
216 { }
217 static inline struct audit_buffer *audit_log_start(struct audit_context *ctx,
218 						   gfp_t gfp_mask, int type)
219 {
220 	return NULL;
221 }
222 static inline __printf(2, 3)
223 void audit_log_format(struct audit_buffer *ab, const char *fmt, ...)
224 { }
225 static inline void audit_log_end(struct audit_buffer *ab)
226 { }
227 static inline void audit_log_n_hex(struct audit_buffer *ab,
228 				   const unsigned char *buf, size_t len)
229 { }
230 static inline void audit_log_n_string(struct audit_buffer *ab,
231 				      const char *buf, size_t n)
232 { }
233 static inline void  audit_log_n_untrustedstring(struct audit_buffer *ab,
234 						const char *string, size_t n)
235 { }
236 static inline void audit_log_untrustedstring(struct audit_buffer *ab,
237 					     const char *string)
238 { }
239 static inline void audit_log_d_path(struct audit_buffer *ab,
240 				    const char *prefix,
241 				    const struct path *path)
242 { }
243 static inline void audit_log_key(struct audit_buffer *ab, char *key)
244 { }
245 static inline void audit_log_path_denied(int type, const char *operation)
246 { }
247 static inline int audit_log_task_context(struct audit_buffer *ab)
248 {
249 	return 0;
250 }
251 static inline void audit_log_task_info(struct audit_buffer *ab)
252 { }
253 
254 static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
255 {
256 	return INVALID_UID;
257 }
258 
259 static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
260 {
261 	return AUDIT_SID_UNSET;
262 }
263 
264 #define audit_enabled AUDIT_OFF
265 
266 static inline int audit_signal_info(int sig, struct task_struct *t)
267 {
268 	return 0;
269 }
270 
271 #endif /* CONFIG_AUDIT */
272 
273 #ifdef CONFIG_AUDIT_COMPAT_GENERIC
274 #define audit_is_compat(arch)  (!((arch) & __AUDIT_ARCH_64BIT))
275 #else
276 #define audit_is_compat(arch)  false
277 #endif
278 
279 #define AUDIT_INODE_PARENT	1	/* dentry represents the parent */
280 #define AUDIT_INODE_HIDDEN	2	/* audit record should be hidden */
281 #define AUDIT_INODE_NOEVAL	4	/* audit record incomplete */
282 
283 #ifdef CONFIG_AUDITSYSCALL
284 #include <asm/syscall.h> /* for syscall_get_arch() */
285 
286 /* These are defined in auditsc.c */
287 				/* Public API */
288 extern int  audit_alloc(struct task_struct *task);
289 extern int  audit_alloc_kernel(struct task_struct *task);
290 extern void __audit_free(struct task_struct *task);
291 extern void __audit_uring_entry(u8 op);
292 extern void __audit_uring_exit(int success, long code);
293 extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1,
294 				  unsigned long a2, unsigned long a3);
295 extern void __audit_syscall_exit(int ret_success, long ret_value);
296 extern struct filename *__audit_reusename(const __user char *uptr);
297 extern void __audit_getname(struct filename *name);
298 extern void __audit_inode(struct filename *name, const struct dentry *dentry,
299 				unsigned int flags);
300 extern void __audit_file(const struct file *);
301 extern void __audit_inode_child(struct inode *parent,
302 				const struct dentry *dentry,
303 				const unsigned char type);
304 extern void audit_seccomp(unsigned long syscall, long signr, int code);
305 extern void audit_seccomp_actions_logged(const char *names,
306 					 const char *old_names, int res);
307 extern void __audit_ptrace(struct task_struct *t);
308 
309 static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx)
310 {
311 	task->audit_context = ctx;
312 }
313 
314 static inline struct audit_context *audit_context(void)
315 {
316 	return current->audit_context;
317 }
318 
319 static inline bool audit_dummy_context(void)
320 {
321 	void *p = audit_context();
322 	return !p || *(int *)p;
323 }
324 static inline void audit_free(struct task_struct *task)
325 {
326 	if (unlikely(task->audit_context))
327 		__audit_free(task);
328 }
329 static inline void audit_uring_entry(u8 op)
330 {
331 	/*
332 	 * We intentionally check audit_context() before audit_enabled as most
333 	 * Linux systems (as of ~2021) rely on systemd which forces audit to
334 	 * be enabled regardless of the user's audit configuration.
335 	 */
336 	if (unlikely(audit_context() && audit_enabled))
337 		__audit_uring_entry(op);
338 }
339 static inline void audit_uring_exit(int success, long code)
340 {
341 	if (unlikely(!audit_dummy_context()))
342 		__audit_uring_exit(success, code);
343 }
344 static inline void audit_syscall_entry(int major, unsigned long a0,
345 				       unsigned long a1, unsigned long a2,
346 				       unsigned long a3)
347 {
348 	if (unlikely(audit_context()))
349 		__audit_syscall_entry(major, a0, a1, a2, a3);
350 }
351 static inline void audit_syscall_exit(void *pt_regs)
352 {
353 	if (unlikely(audit_context())) {
354 		int success = is_syscall_success(pt_regs);
355 		long return_code = regs_return_value(pt_regs);
356 
357 		__audit_syscall_exit(success, return_code);
358 	}
359 }
360 static inline struct filename *audit_reusename(const __user char *name)
361 {
362 	if (unlikely(!audit_dummy_context()))
363 		return __audit_reusename(name);
364 	return NULL;
365 }
366 static inline void audit_getname(struct filename *name)
367 {
368 	if (unlikely(!audit_dummy_context()))
369 		__audit_getname(name);
370 }
371 static inline void audit_inode(struct filename *name,
372 				const struct dentry *dentry,
373 				unsigned int aflags) {
374 	if (unlikely(!audit_dummy_context()))
375 		__audit_inode(name, dentry, aflags);
376 }
377 static inline void audit_file(struct file *file)
378 {
379 	if (unlikely(!audit_dummy_context()))
380 		__audit_file(file);
381 }
382 static inline void audit_inode_parent_hidden(struct filename *name,
383 						const struct dentry *dentry)
384 {
385 	if (unlikely(!audit_dummy_context()))
386 		__audit_inode(name, dentry,
387 				AUDIT_INODE_PARENT | AUDIT_INODE_HIDDEN);
388 }
389 static inline void audit_inode_child(struct inode *parent,
390 				     const struct dentry *dentry,
391 				     const unsigned char type) {
392 	if (unlikely(!audit_dummy_context()))
393 		__audit_inode_child(parent, dentry, type);
394 }
395 void audit_core_dumps(long signr);
396 
397 static inline void audit_ptrace(struct task_struct *t)
398 {
399 	if (unlikely(!audit_dummy_context()))
400 		__audit_ptrace(t);
401 }
402 
403 				/* Private API (for audit.c only) */
404 extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
405 extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
406 extern void __audit_bprm(struct linux_binprm *bprm);
407 extern int __audit_socketcall(int nargs, unsigned long *args);
408 extern int __audit_sockaddr(int len, void *addr);
409 extern void __audit_fd_pair(int fd1, int fd2);
410 extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr);
411 extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec64 *abs_timeout);
412 extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification);
413 extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
414 extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
415 				  const struct cred *new,
416 				  const struct cred *old);
417 extern void __audit_log_capset(const struct cred *new, const struct cred *old);
418 extern void __audit_mmap_fd(int fd, int flags);
419 extern void __audit_log_kern_module(char *name);
420 extern void __audit_fanotify(unsigned int response);
421 extern void __audit_tk_injoffset(struct timespec64 offset);
422 extern void __audit_ntp_log(const struct audit_ntp_data *ad);
423 extern void __audit_log_nfcfg(const char *name, u8 af, unsigned int nentries,
424 			      enum audit_nfcfgop op, gfp_t gfp);
425 
426 static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
427 {
428 	if (unlikely(!audit_dummy_context()))
429 		__audit_ipc_obj(ipcp);
430 }
431 static inline void audit_fd_pair(int fd1, int fd2)
432 {
433 	if (unlikely(!audit_dummy_context()))
434 		__audit_fd_pair(fd1, fd2);
435 }
436 static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode)
437 {
438 	if (unlikely(!audit_dummy_context()))
439 		__audit_ipc_set_perm(qbytes, uid, gid, mode);
440 }
441 static inline void audit_bprm(struct linux_binprm *bprm)
442 {
443 	if (unlikely(!audit_dummy_context()))
444 		__audit_bprm(bprm);
445 }
446 static inline int audit_socketcall(int nargs, unsigned long *args)
447 {
448 	if (unlikely(!audit_dummy_context()))
449 		return __audit_socketcall(nargs, args);
450 	return 0;
451 }
452 
453 static inline int audit_socketcall_compat(int nargs, u32 *args)
454 {
455 	unsigned long a[AUDITSC_ARGS];
456 	int i;
457 
458 	if (audit_dummy_context())
459 		return 0;
460 
461 	for (i = 0; i < nargs; i++)
462 		a[i] = (unsigned long)args[i];
463 	return __audit_socketcall(nargs, a);
464 }
465 
466 static inline int audit_sockaddr(int len, void *addr)
467 {
468 	if (unlikely(!audit_dummy_context()))
469 		return __audit_sockaddr(len, addr);
470 	return 0;
471 }
472 static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
473 {
474 	if (unlikely(!audit_dummy_context()))
475 		__audit_mq_open(oflag, mode, attr);
476 }
477 static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec64 *abs_timeout)
478 {
479 	if (unlikely(!audit_dummy_context()))
480 		__audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout);
481 }
482 static inline void audit_mq_notify(mqd_t mqdes, const struct sigevent *notification)
483 {
484 	if (unlikely(!audit_dummy_context()))
485 		__audit_mq_notify(mqdes, notification);
486 }
487 static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
488 {
489 	if (unlikely(!audit_dummy_context()))
490 		__audit_mq_getsetattr(mqdes, mqstat);
491 }
492 
493 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
494 				       const struct cred *new,
495 				       const struct cred *old)
496 {
497 	if (unlikely(!audit_dummy_context()))
498 		return __audit_log_bprm_fcaps(bprm, new, old);
499 	return 0;
500 }
501 
502 static inline void audit_log_capset(const struct cred *new,
503 				   const struct cred *old)
504 {
505 	if (unlikely(!audit_dummy_context()))
506 		__audit_log_capset(new, old);
507 }
508 
509 static inline void audit_mmap_fd(int fd, int flags)
510 {
511 	if (unlikely(!audit_dummy_context()))
512 		__audit_mmap_fd(fd, flags);
513 }
514 
515 static inline void audit_log_kern_module(char *name)
516 {
517 	if (!audit_dummy_context())
518 		__audit_log_kern_module(name);
519 }
520 
521 static inline void audit_fanotify(unsigned int response)
522 {
523 	if (!audit_dummy_context())
524 		__audit_fanotify(response);
525 }
526 
527 static inline void audit_tk_injoffset(struct timespec64 offset)
528 {
529 	/* ignore no-op events */
530 	if (offset.tv_sec == 0 && offset.tv_nsec == 0)
531 		return;
532 
533 	if (!audit_dummy_context())
534 		__audit_tk_injoffset(offset);
535 }
536 
537 static inline void audit_ntp_init(struct audit_ntp_data *ad)
538 {
539 	memset(ad, 0, sizeof(*ad));
540 }
541 
542 static inline void audit_ntp_set_old(struct audit_ntp_data *ad,
543 				     enum audit_ntp_type type, long long val)
544 {
545 	ad->vals[type].oldval = val;
546 }
547 
548 static inline void audit_ntp_set_new(struct audit_ntp_data *ad,
549 				     enum audit_ntp_type type, long long val)
550 {
551 	ad->vals[type].newval = val;
552 }
553 
554 static inline void audit_ntp_log(const struct audit_ntp_data *ad)
555 {
556 	if (!audit_dummy_context())
557 		__audit_ntp_log(ad);
558 }
559 
560 static inline void audit_log_nfcfg(const char *name, u8 af,
561 				   unsigned int nentries,
562 				   enum audit_nfcfgop op, gfp_t gfp)
563 {
564 	if (audit_enabled)
565 		__audit_log_nfcfg(name, af, nentries, op, gfp);
566 }
567 
568 extern int audit_n_rules;
569 extern int audit_signals;
570 #else /* CONFIG_AUDITSYSCALL */
571 static inline int audit_alloc(struct task_struct *task)
572 {
573 	return 0;
574 }
575 static inline int audit_alloc_kernel(struct task_struct *task)
576 {
577 	return 0;
578 }
579 static inline void audit_free(struct task_struct *task)
580 { }
581 static inline void audit_uring_entry(u8 op)
582 { }
583 static inline void audit_uring_exit(int success, long code)
584 { }
585 static inline void audit_syscall_entry(int major, unsigned long a0,
586 				       unsigned long a1, unsigned long a2,
587 				       unsigned long a3)
588 { }
589 static inline void audit_syscall_exit(void *pt_regs)
590 { }
591 static inline bool audit_dummy_context(void)
592 {
593 	return true;
594 }
595 static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx)
596 { }
597 static inline struct audit_context *audit_context(void)
598 {
599 	return NULL;
600 }
601 static inline struct filename *audit_reusename(const __user char *name)
602 {
603 	return NULL;
604 }
605 static inline void audit_getname(struct filename *name)
606 { }
607 static inline void audit_inode(struct filename *name,
608 				const struct dentry *dentry,
609 				unsigned int aflags)
610 { }
611 static inline void audit_file(struct file *file)
612 {
613 }
614 static inline void audit_inode_parent_hidden(struct filename *name,
615 				const struct dentry *dentry)
616 { }
617 static inline void audit_inode_child(struct inode *parent,
618 				     const struct dentry *dentry,
619 				     const unsigned char type)
620 { }
621 static inline void audit_core_dumps(long signr)
622 { }
623 static inline void audit_seccomp(unsigned long syscall, long signr, int code)
624 { }
625 static inline void audit_seccomp_actions_logged(const char *names,
626 						const char *old_names, int res)
627 { }
628 static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
629 { }
630 static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid,
631 					gid_t gid, umode_t mode)
632 { }
633 static inline void audit_bprm(struct linux_binprm *bprm)
634 { }
635 static inline int audit_socketcall(int nargs, unsigned long *args)
636 {
637 	return 0;
638 }
639 
640 static inline int audit_socketcall_compat(int nargs, u32 *args)
641 {
642 	return 0;
643 }
644 
645 static inline void audit_fd_pair(int fd1, int fd2)
646 { }
647 static inline int audit_sockaddr(int len, void *addr)
648 {
649 	return 0;
650 }
651 static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
652 { }
653 static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len,
654 				     unsigned int msg_prio,
655 				     const struct timespec64 *abs_timeout)
656 { }
657 static inline void audit_mq_notify(mqd_t mqdes,
658 				   const struct sigevent *notification)
659 { }
660 static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
661 { }
662 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
663 				       const struct cred *new,
664 				       const struct cred *old)
665 {
666 	return 0;
667 }
668 static inline void audit_log_capset(const struct cred *new,
669 				    const struct cred *old)
670 { }
671 static inline void audit_mmap_fd(int fd, int flags)
672 { }
673 
674 static inline void audit_log_kern_module(char *name)
675 {
676 }
677 
678 static inline void audit_fanotify(unsigned int response)
679 { }
680 
681 static inline void audit_tk_injoffset(struct timespec64 offset)
682 { }
683 
684 static inline void audit_ntp_init(struct audit_ntp_data *ad)
685 { }
686 
687 static inline void audit_ntp_set_old(struct audit_ntp_data *ad,
688 				     enum audit_ntp_type type, long long val)
689 { }
690 
691 static inline void audit_ntp_set_new(struct audit_ntp_data *ad,
692 				     enum audit_ntp_type type, long long val)
693 { }
694 
695 static inline void audit_ntp_log(const struct audit_ntp_data *ad)
696 { }
697 
698 static inline void audit_ptrace(struct task_struct *t)
699 { }
700 
701 static inline void audit_log_nfcfg(const char *name, u8 af,
702 				   unsigned int nentries,
703 				   enum audit_nfcfgop op, gfp_t gfp)
704 { }
705 
706 #define audit_n_rules 0
707 #define audit_signals 0
708 #endif /* CONFIG_AUDITSYSCALL */
709 
710 static inline bool audit_loginuid_set(struct task_struct *tsk)
711 {
712 	return uid_valid(audit_get_loginuid(tsk));
713 }
714 
715 #endif
716