aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-04 23:59:54 -0800
committerDavid S. Miller <davem@davemloft.net>2009-03-04 23:59:54 -0800
commit77827a7cf3aa415f8afec6d9d0537dda8de90ef1 (patch)
tree503ab81e2b997e3625360b380f1cd18f923a6454 /security
parent9d40bbda599def1e1d155d7f7dca14fe8744bd2b (diff)
parent559595a985e106d2fa9f0c79b7f5805453fed593 (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'security')
-rw-r--r--security/selinux/netlabel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/netlabel.c b/security/selinux/netlabel.c
index 3f4b2664738..350794ab9b4 100644
--- a/security/selinux/netlabel.c
+++ b/security/selinux/netlabel.c
@@ -386,11 +386,12 @@ int selinux_netlbl_inode_permission(struct inode *inode, int mask)
if (!S_ISSOCK(inode->i_mode) ||
((mask & (MAY_WRITE | MAY_APPEND)) == 0))
return 0;
-
sock = SOCKET_I(inode);
sk = sock->sk;
+ if (sk == NULL)
+ return 0;
sksec = sk->sk_security;
- if (sksec->nlbl_state != NLBL_REQUIRE)
+ if (sksec == NULL || sksec->nlbl_state != NLBL_REQUIRE)
return 0;
local_bh_disable();