linux/security/apparmor/include/audit.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * AppArmor security module
 *
 * This file contains AppArmor auditing function definitions.
 *
 * Copyright (C) 1998-2008 Novell/SUSE
 * Copyright 2009-2010 Canonical Ltd.
 */

#ifndef __AA_AUDIT_H
#define __AA_AUDIT_H

#include <linux/audit.h>
#include <linux/fs.h>
#include <linux/lsm_audit.h>
#include <linux/sched.h>
#include <linux/slab.h>

#include "file.h"
#include "label.h"

extern const char *const audit_mode_names[];
#define AUDIT_MAX_INDEX
enum audit_mode {};

enum audit_type {};

#define OP_NULL

#define OP_SYSCTL
#define OP_CAPABLE

#define OP_UNLINK
#define OP_MKDIR
#define OP_RMDIR
#define OP_MKNOD
#define OP_TRUNC
#define OP_LINK
#define OP_SYMLINK
#define OP_RENAME_SRC
#define OP_RENAME_DEST
#define OP_CHMOD
#define OP_CHOWN
#define OP_GETATTR
#define OP_OPEN

#define OP_FRECEIVE
#define OP_FPERM
#define OP_FLOCK
#define OP_FMMAP
#define OP_FMPROT
#define OP_INHERIT

#define OP_PIVOTROOT
#define OP_MOUNT
#define OP_UMOUNT

#define OP_CREATE
#define OP_POST_CREATE
#define OP_BIND
#define OP_CONNECT
#define OP_LISTEN
#define OP_ACCEPT
#define OP_SENDMSG
#define OP_RECVMSG
#define OP_GETSOCKNAME
#define OP_GETPEERNAME
#define OP_GETSOCKOPT
#define OP_SETSOCKOPT
#define OP_SHUTDOWN

#define OP_PTRACE
#define OP_SIGNAL

#define OP_EXEC

#define OP_CHANGE_HAT
#define OP_CHANGE_PROFILE
#define OP_CHANGE_ONEXEC
#define OP_STACK
#define OP_STACK_ONEXEC

#define OP_SETPROCATTR
#define OP_SETRLIMIT

#define OP_PROF_REPL
#define OP_PROF_LOAD
#define OP_PROF_RM

#define OP_USERNS_CREATE

#define OP_URING_OVERRIDE
#define OP_URING_SQPOLL

struct apparmor_audit_data {};

/* macros for dealing with  apparmor_audit_data structure */
#define aad(SA)
#define aad_of_va(VA)

#define DEFINE_AUDIT_DATA(NAME, T, C, X)

void aa_audit_msg(int type, struct apparmor_audit_data *ad,
		  void (*cb) (struct audit_buffer *, void *));
int aa_audit(int type, struct aa_profile *profile,
	     struct apparmor_audit_data *ad,
	     void (*cb) (struct audit_buffer *, void *));

#define aa_audit_error(ERROR, AD, CB)


static inline int complain_error(int error)
{}

void aa_audit_rule_free(void *vrule);
int aa_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule, gfp_t gfp);
int aa_audit_rule_known(struct audit_krule *rule);
int aa_audit_rule_match(u32 sid, u32 field, u32 op, void *vrule);

#endif /* __AA_AUDIT_H */