Skip to contentSkip to conversation

Wrap SMACK and SELINUX audit data structs in ifdefs

PATCH In review Thomas Liu 3 participants 3 messages Jul 9, 2009

Subsystems (2)
lore
Share & tools
lore

Thomas Liu

author
#0 lore raw

PATCH 3/3 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.

---

 include/linux/lsm_audit.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/lsm_audit.h +4 -0
index 40d1b84..a5514a3 100644
@@ -68,6 +68,7 @@ struct common_audit_data {
 	} u;
 	/* this union contains LSM specific data */
 	union {
+#ifdef CONFIG_SECURITY_SMACK
 		/* SMACK data */
 		struct smack_audit_data {
 			const char *function;
@@ -76,6 +77,8 @@ struct common_audit_data {
 			char *request;
 			int result;
 		} smack_audit_data;
+#endif
+#ifdef CONFIG_SECURITY_SELINUX
 		/* SELinux data */
 		struct {
 			u32 ssid;
@@ -86,6 +89,7 @@ struct common_audit_data {
 			struct av_decision *avd;
 			int result;
 		} selinux_audit_data;
+#endif
 	};
 	/* these callback will be implemented by a specific LSM */
 	void (*lsm_pre_audit)(struct audit_buffer *, void *);

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

Acked-by on v1 3/3
#1 lore raw
Quoted 5 lines · Thomas Liu

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.

Quoted 30 lines

---

 include/linux/lsm_audit.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/lsm_audit.h +3 -0
index 40d1b84..a5514a3 100644
@@ -68,6 +68,7 @@ struct common_audit_data {
 	} u;
 	/* this union contains LSM specific data */
 	union {
+#ifdef CONFIG_SECURITY_SMACK
 		/* SMACK data */
 		struct smack_audit_data {
 			const char *function;
@@ -76,6 +77,8 @@ struct common_audit_data {
 			char *request;
 			int result;
 		} smack_audit_data;
+#endif
+#ifdef CONFIG_SECURITY_SELINUX
 		/* SELinux data */
 		struct {
 			u32 ssid;

include/linux/lsm_audit.h struct common_audit_data { · line 95

Quoted 7 lines
include/linux/lsm_audit.h +1 -0
@@ -86,6 +89,7 @@ struct common_audit_data {
 			struct av_decision *avd;
 			int result;
 		} selinux_audit_data;
+#endif
 	};
 	/* these callback will be implemented by a specific LSM */
 	void (*lsm_pre_audit)(struct audit_buffer *, void *);

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

maintainer
#2 lore raw
In reply to Thomas Liu
Quoted 5 lines · Thomas Liu

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.

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.