summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-11-21 06:52:35 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-21 06:52:35 -1000
commit85c0805a8da23c8bc0b03d70fbf11e84cb2d6df6 (patch)
tree21777353c07b0bc85f38ad7910604659b55a06d4
parent916492b1e1a186260951831c53a53d8a448dc026 (diff)
parent88a693b5c1287be4da937699cb82068ce9db0135 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull selinux RCU fixlet from James Morris. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: selinux: fix sel_netnode_insert() suspicious rcu dereference
-rw-r--r--security/selinux/netnode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c
index 28f911cdd7c7..c5454c0477c3 100644
--- a/security/selinux/netnode.c
+++ b/security/selinux/netnode.c
@@ -174,7 +174,8 @@ static void sel_netnode_insert(struct sel_netnode *node)
if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) {
struct sel_netnode *tail;
tail = list_entry(
- rcu_dereference(sel_netnode_hash[idx].list.prev),
+ rcu_dereference_protected(sel_netnode_hash[idx].list.prev,
+ lockdep_is_held(&sel_netnode_lock)),
struct sel_netnode, list);
list_del_rcu(&tail->list);
kfree_rcu(tail, rcu);