audit.h 19 KB

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