]> err.no Git - linux-2.6/blobdiff - security/selinux/include/objsec.h
Pull video into test branch
[linux-2.6] / security / selinux / include / objsec.h
index cf54a304169a0fc4ce2224e26d99221aff5821e3..91b88f0ba20c42b0ccf22cf06bd4abfac32e77c0 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/fs.h>
 #include <linux/binfmts.h>
 #include <linux/in.h>
+#include <linux/spinlock.h>
 #include "flask.h"
 #include "avc.h"
 
@@ -44,7 +45,7 @@ struct inode_security_struct {
        u32 sid;             /* SID of this object */
        u16 sclass;       /* security class of this object */
        unsigned char initialized;     /* initialization flag */
-       struct semaphore sem;
+       struct mutex lock;
        unsigned char inherit;         /* inherit SID from parent entry */
 };
 
@@ -57,12 +58,13 @@ struct file_security_struct {
 struct superblock_security_struct {
        struct super_block *sb;         /* back pointer to sb object */
        struct list_head list;          /* list of superblock_security_struct */
-       u32 sid;              /* SID of file system */
+       u32 sid;                        /* SID of file system superblock */
        u32 def_sid;                    /* default SID for labeling */
+       u32 mntpoint_sid;               /* SECURITY_FS_USE_MNTPOINT context for files */
        unsigned int behavior;          /* labeling behavior */
        unsigned char initialized;      /* initialization flag */
        unsigned char proc;             /* proc fs */
-       struct semaphore sem;
+       struct mutex lock;
        struct list_head isec_head;
        spinlock_t isec_lock;
 };
@@ -98,7 +100,17 @@ struct netif_security_struct {
 
 struct sk_security_struct {
        struct sock *sk;                /* back pointer to sk object */
+       u32 sid;                        /* SID of this object */
        u32 peer_sid;                   /* SID of peer */
+#ifdef CONFIG_NETLABEL
+       u16 sclass;                     /* sock security class */
+       enum {                          /* NetLabel state */
+               NLBL_UNSET = 0,
+               NLBL_REQUIRE,
+               NLBL_LABELED,
+       } nlbl_state;
+       spinlock_t nlbl_lock;           /* protects nlbl_state */
+#endif
 };
 
 struct key_security_struct {