diff options
| author | Ricardo Robaina <rrobaina@redhat.com> | 2025-11-14 09:36:16 -0300 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2025-12-16 11:04:14 -0500 |
| commit | f19590b07cb620be1fcd5474c49515e21a05d406 (patch) | |
| tree | ee1512d64f275b0fb7f3bdcbdde39cdd3e11e782 /include/linux/audit.h | |
| parent | 4f493a6079b588cf1f04ce5ed6cdad45ab0d53dc (diff) | |
audit: add audit_log_nf_skb helper function
Netfilter code (net/netfilter/nft_log.c and net/netfilter/xt_AUDIT.c)
have to be kept in sync. Both source files had duplicated versions of
audit_ip4() and audit_ip6() functions, which can result in lack of
consistency and/or duplicated work.
This patch adds a helper function in audit.c that can be called by
netfilter code commonly, aiming to improve maintainability and
consistency.
Suggested-by: Florian Westphal <fw@strlen.de>
Suggested-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include/linux/audit.h')
| -rw-r--r-- | include/linux/audit.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 536f8ee8da81..d8173af498ba 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -195,6 +195,8 @@ extern int audit_log_subj_ctx(struct audit_buffer *ab, struct lsm_prop *prop); extern int audit_log_obj_ctx(struct audit_buffer *ab, struct lsm_prop *prop); extern int audit_log_task_context(struct audit_buffer *ab); extern void audit_log_task_info(struct audit_buffer *ab); +extern int audit_log_nf_skb(struct audit_buffer *ab, + const struct sk_buff *skb, u8 nfproto); extern int audit_update_lsm_rules(void); @@ -272,6 +274,12 @@ static inline int audit_log_task_context(struct audit_buffer *ab) static inline void audit_log_task_info(struct audit_buffer *ab) { } +static inline int audit_log_nf_skb(struct audit_buffer *ab, + const struct sk_buff *skb, u8 nfproto) +{ + return 0; +} + static inline kuid_t audit_get_loginuid(struct task_struct *tsk) { return INVALID_UID; |
