SELinux: move SELINUX_MAGIC into magic.h
authorEric Paris <eparis@redhat.com>
Mon, 18 May 2009 14:26:10 +0000 (10:26 -0400)
committerJames Morris <jmorris@namei.org>
Mon, 18 May 2009 22:19:00 +0000 (08:19 +1000)
The selinuxfs superblock magic is used inside the IMA code, but is being
defined in two places and could someday get out of sync.  This patch moves the
declaration into magic.h so it is only done once.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
include/linux/magic.h
security/integrity/ima/ima_policy.c
security/selinux/include/security.h

index 5b4e28bcb788de92ffc3993c39e912f675a11c7f..927138cf30502c757f806b76471c86bb45466f5d 100644 (file)
@@ -9,6 +9,7 @@
 #define DEBUGFS_MAGIC          0x64626720
 #define SYSFS_MAGIC            0x62656572
 #define SECURITYFS_MAGIC       0x73636673
+#define SELINUX_MAGIC          0xf97cff8c
 #define TMPFS_MAGIC            0x01021994
 #define SQUASHFS_MAGIC         0x73717368
 #define EFS_SUPER_MAGIC                0x414A53
index dec6dcb1c8de5765049d016bd53ae8230a9dbeb5..31d677f7c65f52406c17d7f5d7c45f9573dc9065 100644 (file)
@@ -49,14 +49,12 @@ struct ima_measure_rule_entry {
  * written in terms of .action, .func, .mask, .fsmagic, and .uid
  */
 static struct ima_measure_rule_entry default_rules[] = {
-       {.action = DONT_MEASURE,.fsmagic = PROC_SUPER_MAGIC,
-        .flags = IMA_FSMAGIC},
+       {.action = DONT_MEASURE,.fsmagic = PROC_SUPER_MAGIC,.flags = IMA_FSMAGIC},
        {.action = DONT_MEASURE,.fsmagic = SYSFS_MAGIC,.flags = IMA_FSMAGIC},
        {.action = DONT_MEASURE,.fsmagic = DEBUGFS_MAGIC,.flags = IMA_FSMAGIC},
        {.action = DONT_MEASURE,.fsmagic = TMPFS_MAGIC,.flags = IMA_FSMAGIC},
-       {.action = DONT_MEASURE,.fsmagic = SECURITYFS_MAGIC,
-        .flags = IMA_FSMAGIC},
-       {.action = DONT_MEASURE,.fsmagic = 0xF97CFF8C,.flags = IMA_FSMAGIC},
+       {.action = DONT_MEASURE,.fsmagic = SECURITYFS_MAGIC,.flags = IMA_FSMAGIC},
+       {.action = DONT_MEASURE,.fsmagic = SELINUX_MAGIC,.flags = IMA_FSMAGIC},
        {.action = MEASURE,.func = FILE_MMAP,.mask = MAY_EXEC,
         .flags = IMA_FUNC | IMA_MASK},
        {.action = MEASURE,.func = BPRM_CHECK,.mask = MAY_EXEC,
index a7be3f01fb08143c303d555006b42f327fb1e729..ca835795a8b322e7e4398d065d2eb0976741e2ad 100644 (file)
@@ -8,14 +8,13 @@
 #ifndef _SELINUX_SECURITY_H_
 #define _SELINUX_SECURITY_H_
 
+#include <linux/magic.h>
 #include "flask.h"
 
 #define SECSID_NULL                    0x00000000 /* unspecified SID */
 #define SECSID_WILD                    0xffffffff /* wildcard SID */
 #define SECCLASS_NULL                  0x0000 /* no class */
 
-#define SELINUX_MAGIC 0xf97cff8c
-
 /* Identify specific policy version changes */
 #define POLICYDB_VERSION_BASE          15
 #define POLICYDB_VERSION_BOOL          16
This page took 0.030415 seconds and 5 git commands to generate.