diff options
author | Eric Paris <eparis@redhat.com> | 2006-09-26 08:32:01 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 17:48:53 +0200 |
commit | 23970741720360de9dd0a4e87fbeb1d5927aa474 (patch) | |
tree | 2dc28ddfeae751a673d43e1925fd131d6ed3e222 /security/selinux/ss/services.c | |
parent | [PATCH] SELinux: eliminate inode_security_set_security (diff) | |
download | linux-23970741720360de9dd0a4e87fbeb1d5927aa474.tar.xz linux-23970741720360de9dd0a4e87fbeb1d5927aa474.zip |
[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 '')
-rw-r--r-- | security/selinux/ss/services.c | 4 |
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) sock = SOCKET_I(inode); isec = inode->i_security; sksec = sock->sk->sk_security; - down(&isec->sem); + mutex_lock(&isec->lock); if (unlikely(sksec->nlbl_state == NLBL_REQUIRE && (mask & (MAY_WRITE | MAY_APPEND)))) { lock_sock(sock->sk); @@ -2586,7 +2586,7 @@ int selinux_netlbl_inode_permission(struct inode *inode, int mask) release_sock(sock->sk); } else rc = 0; - up(&isec->sem); + mutex_unlock(&isec->lock); return rc; } |