aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2006-09-26 02:32:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:53 -0400
commitbc7e982b84aceef0a040c88ff659eb5c83818f72 (patch)
tree0e351e00c5fa90cd5b6a9b9f710e95ecb953b1f2
parent23970741720360de9dd0a4e87fbeb1d5927aa474 (diff)
[PATCH] SELinux: convert sbsec semaphore to a mutex
This patch converts the semaphore in the superblock security struct to a mutex. No locking changes or other code changes are done. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--security/selinux/hooks.c7
-rw-r--r--security/selinux/include/objsec.h2
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);
692out: 691out:
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};