diff options
author | Paul Moore <paul.moore@hp.com> | 2007-01-05 21:08:21 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-01-09 09:30:00 +0100 |
commit | 797951200679f1d5ea12a2e58cc7bdbc2848764c (patch) | |
tree | aaf0785e317ad5f4651324669bcafbd163d1833d /security/selinux | |
parent | [Bluetooth] Correct SCO buffer for Broadcom based Dell laptops (diff) | |
download | linux-797951200679f1d5ea12a2e58cc7bdbc2848764c.tar.xz linux-797951200679f1d5ea12a2e58cc7bdbc2848764c.zip |
NetLabel: correct locking in selinux_netlbl_socket_setsid()
The spinlock protecting the update of the "sksec->nlbl_state" variable is not
currently softirq safe which can lead to problems. This patch fixes this by
changing the spin_{un}lock() functions into spin_{un}lock_bh() functions.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux')
-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 372eaade3ca6..3eb1fa9f0de1 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -2491,9 +2491,9 @@ static int selinux_netlbl_socket_setsid(struct socket *sock, u32 sid) rc = netlbl_socket_setattr(sock, &secattr); if (rc == 0) { - spin_lock(&sksec->nlbl_lock); + spin_lock_bh(&sksec->nlbl_lock); sksec->nlbl_state = NLBL_LABELED; - spin_unlock(&sksec->nlbl_lock); + spin_unlock_bh(&sksec->nlbl_lock); } netlbl_socket_setsid_return: |