]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - security/selinux/include/objsec.h
SELinux: Convert the netif code to use ifindex values
[linux-2.6-omap-h63xx.git] / security / selinux / include / objsec.h
index 940178865fc78c97e37979f215204b2e1d17fc38..2d0a92e97d5adaaf4961b0c130b80d8e1921b9c6 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 */
 };
 
@@ -52,6 +53,8 @@ struct file_security_struct {
        struct file *file;              /* back pointer to file object */
        u32 sid;              /* SID of open file description */
        u32 fown_sid;         /* SID of file owner (for SIGIO) */
+       u32 isid;             /* SID of inode at the time of file open */
+       u32 pseqno;           /* Policy seqno at the time of file open */
 };
 
 struct superblock_security_struct {
@@ -62,8 +65,9 @@ struct superblock_security_struct {
        u32 mntpoint_sid;               /* SECURITY_FS_USE_MNTPOINT context for files */
        unsigned int behavior;          /* labeling behavior */
        unsigned char initialized;      /* initialization flag */
+       unsigned char flags;            /* which mount options were specified */
        unsigned char proc;             /* proc fs */
-       struct semaphore sem;
+       struct mutex lock;
        struct list_head isec_head;
        spinlock_t isec_lock;
 };
@@ -92,14 +96,23 @@ struct bprm_security_struct {
 };
 
 struct netif_security_struct {
-       struct net_device *dev;         /* back pointer */
-       u32 if_sid;                     /* SID for this interface */
-       u32 msg_sid;                    /* default SID for messages received on this interface */
+       int ifindex;                    /* device index */
+       u32 sid;                        /* SID for this interface */
 };
 
 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 {