aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/services.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2006-09-26 02:32:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:53 -0400
commit23970741720360de9dd0a4e87fbeb1d5927aa474 (patch)
tree2dc28ddfeae751a673d43e1925fd131d6ed3e222 /security/selinux/ss/services.c
parent296fddf7513c155adbd3a443d12add1f62b5cddb (diff)
[PATCH] SELinux: change isec semaphore to a mutex
This patch converts the remaining isec->sem into a mutex. Very similar locking is provided as before only in the faster smaller mutex rather than a semaphore. An out_unlock path is introduced rather than the conditional unlocking found in the original code. 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>
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r--security/selinux/ss/services.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 988079f45294..0c219a1b3243 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -2578,7 +2578,7 @@ int selinux_netlbl_inode_permission(struct inode *inode, int mask)
2578 sock = SOCKET_I(inode); 2578 sock = SOCKET_I(inode);
2579 isec = inode->i_security; 2579 isec = inode->i_security;
2580 sksec = sock->sk->sk_security; 2580 sksec = sock->sk->sk_security;
2581 down(&isec->sem); 2581 mutex_lock(&isec->lock);
2582 if (unlikely(sksec->nlbl_state == NLBL_REQUIRE && 2582 if (unlikely(sksec->nlbl_state == NLBL_REQUIRE &&
2583 (mask & (MAY_WRITE | MAY_APPEND)))) { 2583 (mask & (MAY_WRITE | MAY_APPEND)))) {
2584 lock_sock(sock->sk); 2584 lock_sock(sock->sk);
@@ -2586,7 +2586,7 @@ int selinux_netlbl_inode_permission(struct inode *inode, int mask)
2586 release_sock(sock->sk); 2586 release_sock(sock->sk);
2587 } else 2587 } else
2588 rc = 0; 2588 rc = 0;
2589 up(&isec->sem); 2589 mutex_unlock(&isec->lock);
2590 2590
2591 return rc; 2591 return rc;
2592} 2592}