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