diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 19:44:08 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 19:44:08 -0400 |
| commit | 0342cbcfced2ee937d7c8e1c63f3d3082da7c7dc (patch) | |
| tree | fb98291d321a50de2dfd99f9bcaa33274f0c3952 /security | |
| parent | 391d6276db9fbdedfbc30e1b56390414f0e55988 (diff) | |
| parent | 7f70893173b056df691b2ee7546bb44fd9abae6a (diff) | |
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
rcu: Fix wrong check in list_splice_init_rcu()
net,rcu: Convert call_rcu(xt_rateest_free_rcu) to kfree_rcu()
sysctl,rcu: Convert call_rcu(free_head) to kfree
vmalloc,rcu: Convert call_rcu(rcu_free_vb) to kfree_rcu()
vmalloc,rcu: Convert call_rcu(rcu_free_va) to kfree_rcu()
ipc,rcu: Convert call_rcu(ipc_immediate_free) to kfree_rcu()
ipc,rcu: Convert call_rcu(free_un) to kfree_rcu()
security,rcu: Convert call_rcu(sel_netport_free) to kfree_rcu()
security,rcu: Convert call_rcu(sel_netnode_free) to kfree_rcu()
ia64,rcu: Convert call_rcu(sn_irq_info_free) to kfree_rcu()
block,rcu: Convert call_rcu(disk_free_ptbl_rcu_cb) to kfree_rcu()
scsi,rcu: Convert call_rcu(fc_rport_free_rcu) to kfree_rcu()
audit_tree,rcu: Convert call_rcu(__put_tree) to kfree_rcu()
security,rcu: Convert call_rcu(whitelist_item_free) to kfree_rcu()
md,rcu: Convert call_rcu(free_conf) to kfree_rcu()
Diffstat (limited to 'security')
| -rw-r--r-- | security/device_cgroup.c | 10 | ||||
| -rw-r--r-- | security/selinux/netnode.c | 20 | ||||
| -rw-r--r-- | security/selinux/netport.c | 20 |
3 files changed, 5 insertions, 45 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 1be68269e1c2..4450fbeec411 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
| @@ -125,14 +125,6 @@ static int dev_whitelist_add(struct dev_cgroup *dev_cgroup, | |||
| 125 | return 0; | 125 | return 0; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static void whitelist_item_free(struct rcu_head *rcu) | ||
| 129 | { | ||
| 130 | struct dev_whitelist_item *item; | ||
| 131 | |||
| 132 | item = container_of(rcu, struct dev_whitelist_item, rcu); | ||
| 133 | kfree(item); | ||
| 134 | } | ||
| 135 | |||
| 136 | /* | 128 | /* |
| 137 | * called under devcgroup_mutex | 129 | * called under devcgroup_mutex |
| 138 | */ | 130 | */ |
| @@ -155,7 +147,7 @@ remove: | |||
| 155 | walk->access &= ~wh->access; | 147 | walk->access &= ~wh->access; |
| 156 | if (!walk->access) { | 148 | if (!walk->access) { |
| 157 | list_del_rcu(&walk->list); | 149 | list_del_rcu(&walk->list); |
| 158 | call_rcu(&walk->rcu, whitelist_item_free); | 150 | kfree_rcu(walk, rcu); |
| 159 | } | 151 | } |
| 160 | } | 152 | } |
| 161 | } | 153 | } |
diff --git a/security/selinux/netnode.c b/security/selinux/netnode.c index 3618251d0fdb..8b691a863186 100644 --- a/security/selinux/netnode.c +++ b/security/selinux/netnode.c | |||
| @@ -69,22 +69,6 @@ static DEFINE_SPINLOCK(sel_netnode_lock); | |||
| 69 | static struct sel_netnode_bkt sel_netnode_hash[SEL_NETNODE_HASH_SIZE]; | 69 | static struct sel_netnode_bkt sel_netnode_hash[SEL_NETNODE_HASH_SIZE]; |
| 70 | 70 | ||
| 71 | /** | 71 | /** |
| 72 | * sel_netnode_free - Frees a node entry | ||
| 73 | * @p: the entry's RCU field | ||
| 74 | * | ||
| 75 | * Description: | ||
| 76 | * This function is designed to be used as a callback to the call_rcu() | ||
| 77 | * function so that memory allocated to a hash table node entry can be | ||
| 78 | * released safely. | ||
| 79 | * | ||
| 80 | */ | ||
| 81 | static void sel_netnode_free(struct rcu_head *p) | ||
| 82 | { | ||
| 83 | struct sel_netnode *node = container_of(p, struct sel_netnode, rcu); | ||
| 84 | kfree(node); | ||
| 85 | } | ||
| 86 | |||
| 87 | /** | ||
| 88 | * sel_netnode_hashfn_ipv4 - IPv4 hashing function for the node table | 72 | * sel_netnode_hashfn_ipv4 - IPv4 hashing function for the node table |
| 89 | * @addr: IPv4 address | 73 | * @addr: IPv4 address |
| 90 | * | 74 | * |
| @@ -193,7 +177,7 @@ static void sel_netnode_insert(struct sel_netnode *node) | |||
| 193 | rcu_dereference(sel_netnode_hash[idx].list.prev), | 177 | rcu_dereference(sel_netnode_hash[idx].list.prev), |
| 194 | struct sel_netnode, list); | 178 | struct sel_netnode, list); |
| 195 | list_del_rcu(&tail->list); | 179 | list_del_rcu(&tail->list); |
| 196 | call_rcu(&tail->rcu, sel_netnode_free); | 180 | kfree_rcu(tail, rcu); |
| 197 | } else | 181 | } else |
| 198 | sel_netnode_hash[idx].size++; | 182 | sel_netnode_hash[idx].size++; |
| 199 | } | 183 | } |
| @@ -306,7 +290,7 @@ static void sel_netnode_flush(void) | |||
| 306 | list_for_each_entry_safe(node, node_tmp, | 290 | list_for_each_entry_safe(node, node_tmp, |
| 307 | &sel_netnode_hash[idx].list, list) { | 291 | &sel_netnode_hash[idx].list, list) { |
| 308 | list_del_rcu(&node->list); | 292 | list_del_rcu(&node->list); |
| 309 | call_rcu(&node->rcu, sel_netnode_free); | 293 | kfree_rcu(node, rcu); |
| 310 | } | 294 | } |
| 311 | sel_netnode_hash[idx].size = 0; | 295 | sel_netnode_hash[idx].size = 0; |
| 312 | } | 296 | } |
diff --git a/security/selinux/netport.c b/security/selinux/netport.c index cfe2d72d3fb7..ae76e298de7d 100644 --- a/security/selinux/netport.c +++ b/security/selinux/netport.c | |||
| @@ -68,22 +68,6 @@ static DEFINE_SPINLOCK(sel_netport_lock); | |||
| 68 | static struct sel_netport_bkt sel_netport_hash[SEL_NETPORT_HASH_SIZE]; | 68 | static struct sel_netport_bkt sel_netport_hash[SEL_NETPORT_HASH_SIZE]; |
| 69 | 69 | ||
| 70 | /** | 70 | /** |
| 71 | * sel_netport_free - Frees a port entry | ||
| 72 | * @p: the entry's RCU field | ||
| 73 | * | ||
| 74 | * Description: | ||
| 75 | * This function is designed to be used as a callback to the call_rcu() | ||
| 76 | * function so that memory allocated to a hash table port entry can be | ||
| 77 | * released safely. | ||
| 78 | * | ||
| 79 | */ | ||
| 80 | static void sel_netport_free(struct rcu_head *p) | ||
| 81 | { | ||
| 82 | struct sel_netport *port = container_of(p, struct sel_netport, rcu); | ||
| 83 | kfree(port); | ||
| 84 | } | ||
| 85 | |||
| 86 | /** | ||
| 87 | * sel_netport_hashfn - Hashing function for the port table | 71 | * sel_netport_hashfn - Hashing function for the port table |
| 88 | * @pnum: port number | 72 | * @pnum: port number |
| 89 | * | 73 | * |
| @@ -142,7 +126,7 @@ static void sel_netport_insert(struct sel_netport *port) | |||
| 142 | rcu_dereference(sel_netport_hash[idx].list.prev), | 126 | rcu_dereference(sel_netport_hash[idx].list.prev), |
| 143 | struct sel_netport, list); | 127 | struct sel_netport, list); |
| 144 | list_del_rcu(&tail->list); | 128 | list_del_rcu(&tail->list); |
| 145 | call_rcu(&tail->rcu, sel_netport_free); | 129 | kfree_rcu(tail, rcu); |
| 146 | } else | 130 | } else |
| 147 | sel_netport_hash[idx].size++; | 131 | sel_netport_hash[idx].size++; |
| 148 | } | 132 | } |
| @@ -241,7 +225,7 @@ static void sel_netport_flush(void) | |||
| 241 | list_for_each_entry_safe(port, port_tmp, | 225 | list_for_each_entry_safe(port, port_tmp, |
| 242 | &sel_netport_hash[idx].list, list) { | 226 | &sel_netport_hash[idx].list, list) { |
| 243 | list_del_rcu(&port->list); | 227 | list_del_rcu(&port->list); |
| 244 | call_rcu(&port->rcu, sel_netport_free); | 228 | kfree_rcu(port, rcu); |
| 245 | } | 229 | } |
| 246 | sel_netport_hash[idx].size = 0; | 230 | sel_netport_hash[idx].size = 0; |
| 247 | } | 231 | } |
