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
This commit is contained in:
Linus Torvalds 2012-11-21 06:52:35 -10:00
commit 85c0805a8d
1 changed files with 2 additions and 1 deletions

View File

@ -174,7 +174,8 @@ static void sel_netnode_insert(struct sel_netnode *node)
if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) { if (sel_netnode_hash[idx].size == SEL_NETNODE_HASH_BKT_LIMIT) {
struct sel_netnode *tail; struct sel_netnode *tail;
tail = list_entry( 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); struct sel_netnode, list);
list_del_rcu(&tail->list); list_del_rcu(&tail->list);
kfree_rcu(tail, rcu); kfree_rcu(tail, rcu);