Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65c3f0a2 authored by Thomas Liu's avatar Thomas Liu Committed by James Morris
Browse files

security: Wrap SMACK and SELINUX audit data structs in ifdefs



Wrapped the smack_audit_data and selinux_audit_data
structs in include/linux/lsm_audit.h in ifdefs so that the
union will always be the correct size.

Signed-off-by: default avatarThomas Liu <tliu@redhat.com>
Acked-by: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent d4131ded
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -68,6 +68,7 @@ struct common_audit_data {
	} u;
	} u;
	/* this union contains LSM specific data */
	/* this union contains LSM specific data */
	union {
	union {
#ifdef CONFIG_SECURITY_SMACK
		/* SMACK data */
		/* SMACK data */
		struct smack_audit_data {
		struct smack_audit_data {
			const char *function;
			const char *function;
@@ -76,6 +77,8 @@ struct common_audit_data {
			char *request;
			char *request;
			int result;
			int result;
		} smack_audit_data;
		} smack_audit_data;
#endif
#ifdef CONFIG_SECURITY_SELINUX
		/* SELinux data */
		/* SELinux data */
		struct {
		struct {
			u32 ssid;
			u32 ssid;
@@ -86,6 +89,7 @@ struct common_audit_data {
			struct av_decision *avd;
			struct av_decision *avd;
			int result;
			int result;
		} selinux_audit_data;
		} selinux_audit_data;
#endif
	};
	};
	/* these callback will be implemented by a specific LSM */
	/* these callback will be implemented by a specific LSM */
	void (*lsm_pre_audit)(struct audit_buffer *, void *);
	void (*lsm_pre_audit)(struct audit_buffer *, void *);