diff options
author | Eric W. Biederman <ebiederm@aristanetworks.com> | 2009-02-22 03:09:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-03 04:14:15 -0500 |
commit | 6eb0777228f31932fc941eafe8b08848466630a1 (patch) | |
tree | 41154f46d5a87add0e60cff21ebd2c88493813f0 | |
parent | 176c39af29bc4edaf37f663553eeaacd47b5bc9c (diff) |
netns: Fix icmp shutdown.
Recently I had a kernel panic in icmp_send during a network namespace
cleanup. There were packets in the arp queue that failed to be sent
and we attempted to generate an ICMP host unreachable message, but
failed because icmp_sk_exit had already been called.
The network devices are removed from a network namespace and their
arp queues are flushed before we do attempt to shutdown subsystems
so this error should have been impossible.
It turns out icmp_init is using register_pernet_device instead
of register_pernet_subsys. Which resulted in icmp being shut down
while we still had the possibility of packets in flight, making
a nasty NULL pointer deference in interrupt context possible.
Changing this to register_pernet_subsys fixes the problem in
my testing.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/icmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 705b33b184a3..fc562d29cc46 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -1205,7 +1205,7 @@ static struct pernet_operations __net_initdata icmp_sk_ops = { | |||
1205 | 1205 | ||
1206 | int __init icmp_init(void) | 1206 | int __init icmp_init(void) |
1207 | { | 1207 | { |
1208 | return register_pernet_device(&icmp_sk_ops); | 1208 | return register_pernet_subsys(&icmp_sk_ops); |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | EXPORT_SYMBOL(icmp_err_convert); | 1211 | EXPORT_SYMBOL(icmp_err_convert); |