diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 7 | ||||
-rw-r--r-- | security/selinux/include/objsec.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 63ad57ab44fc..55cec4d6f117 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #include <net/ip.h> /* for sysctl_local_port_range[] */ | 51 | #include <net/ip.h> /* for sysctl_local_port_range[] */ |
52 | #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ | 52 | #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ |
53 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
54 | #include <asm/semaphore.h> | ||
55 | #include <asm/ioctls.h> | 54 | #include <asm/ioctls.h> |
56 | #include <linux/bitops.h> | 55 | #include <linux/bitops.h> |
57 | #include <linux/interrupt.h> | 56 | #include <linux/interrupt.h> |
@@ -243,7 +242,7 @@ static int superblock_alloc_security(struct super_block *sb) | |||
243 | if (!sbsec) | 242 | if (!sbsec) |
244 | return -ENOMEM; | 243 | return -ENOMEM; |
245 | 244 | ||
246 | init_MUTEX(&sbsec->sem); | 245 | mutex_init(&sbsec->lock); |
247 | INIT_LIST_HEAD(&sbsec->list); | 246 | INIT_LIST_HEAD(&sbsec->list); |
248 | INIT_LIST_HEAD(&sbsec->isec_head); | 247 | INIT_LIST_HEAD(&sbsec->isec_head); |
249 | spin_lock_init(&sbsec->isec_lock); | 248 | spin_lock_init(&sbsec->isec_lock); |
@@ -595,7 +594,7 @@ static int superblock_doinit(struct super_block *sb, void *data) | |||
595 | struct inode *inode = root->d_inode; | 594 | struct inode *inode = root->d_inode; |
596 | int rc = 0; | 595 | int rc = 0; |
597 | 596 | ||
598 | down(&sbsec->sem); | 597 | mutex_lock(&sbsec->lock); |
599 | if (sbsec->initialized) | 598 | if (sbsec->initialized) |
600 | goto out; | 599 | goto out; |
601 | 600 | ||
@@ -690,7 +689,7 @@ next_inode: | |||
690 | } | 689 | } |
691 | spin_unlock(&sbsec->isec_lock); | 690 | spin_unlock(&sbsec->isec_lock); |
692 | out: | 691 | out: |
693 | up(&sbsec->sem); | 692 | mutex_unlock(&sbsec->lock); |
694 | return rc; | 693 | return rc; |
695 | } | 694 | } |
696 | 695 | ||
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 7d5a0289878b..ef2267fea8bd 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h | |||
@@ -63,7 +63,7 @@ struct superblock_security_struct { | |||
63 | unsigned int behavior; /* labeling behavior */ | 63 | unsigned int behavior; /* labeling behavior */ |
64 | unsigned char initialized; /* initialization flag */ | 64 | unsigned char initialized; /* initialization flag */ |
65 | unsigned char proc; /* proc fs */ | 65 | unsigned char proc; /* proc fs */ |
66 | struct semaphore sem; | 66 | struct mutex lock; |
67 | struct list_head isec_head; | 67 | struct list_head isec_head; |
68 | spinlock_t isec_lock; | 68 | spinlock_t isec_lock; |
69 | }; | 69 | }; |