aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorXiaotian Feng <dfeng@redhat.com>2010-11-02 12:11:05 -0400
committerDavid S. Miller <davem@davemloft.net>2010-11-03 21:50:07 -0400
commit41bb78b4b9adb21cf2c395b6b880aaae99c788b7 (patch)
tree34f099b4773150e0fa850d56be33fd46c3d29907 /net
parent8200a59f24aeca379660f80658a8c0c343ca5c31 (diff)
net dst: fix percpu_counter list corruption and poison overwritten
There're some percpu_counter list corruption and poison overwritten warnings in recent kernel, which is resulted by fc66f95c. commit fc66f95c switches to use percpu_counter, in ip6_route_net_init, kernel init the percpu_counter for dst entries, but, the percpu_counter is never destroyed in ip6_route_net_exit. So if the related data is freed by kernel, the freed percpu_counter is still on the list, then if we insert/remove other percpu_counter, list corruption resulted. Also, if the insert/remove option modifies the ->prev,->next pointer of the freed value, the poison overwritten is resulted then. With the following patch, the percpu_counter list corruption and poison overwritten warnings disappeared. Signed-off-by: Xiaotian Feng <dfeng@redhat.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi> Cc: James Morris <jmorris@namei.org> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: Patrick McHardy <kaber@trash.net> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/route.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 25661f968f3f..fc328339be99 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2741,6 +2741,7 @@ static void __net_exit ip6_route_net_exit(struct net *net)
2741 kfree(net->ipv6.ip6_prohibit_entry); 2741 kfree(net->ipv6.ip6_prohibit_entry);
2742 kfree(net->ipv6.ip6_blk_hole_entry); 2742 kfree(net->ipv6.ip6_blk_hole_entry);
2743#endif 2743#endif
2744 dst_entries_destroy(&net->ipv6.ip6_dst_ops);
2744} 2745}
2745 2746
2746static struct pernet_operations ip6_route_net_ops = { 2747static struct pernet_operations ip6_route_net_ops = {
@@ -2832,5 +2833,6 @@ void ip6_route_cleanup(void)
2832 xfrm6_fini(); 2833 xfrm6_fini();
2833 fib6_gc_cleanup(); 2834 fib6_gc_cleanup();
2834 unregister_pernet_subsys(&ip6_route_net_ops); 2835 unregister_pernet_subsys(&ip6_route_net_ops);
2836 dst_entries_destroy(&ip6_dst_blackhole_ops);
2835 kmem_cache_destroy(ip6_dst_ops_template.kmem_cachep); 2837 kmem_cache_destroy(ip6_dst_ops_template.kmem_cachep);
2836} 2838}