linux/net/ipv4
Francesco Ruggeri 896b6af471 net: ipv4: ipmr_expire_timer causes crash when removing net namespace
[ Upstream commit acbb219d5f ]

When tearing down a net namespace, ipv4 mr_table structures are freed
without first deactivating their timers. This can result in a crash in
run_timer_softirq.
This patch mimics the corresponding behaviour in ipv6.
Locking and synchronization seem to be adequate.
We are about to kfree mrt, so existing code should already make sure that
no other references to mrt are pending or can be created by incoming traffic.
The functions invoked here do not cause new references to mrt or other
race conditions to be created.
Invoking del_timer_sync guarantees that ipmr_expire_timer is inactive.
Both ipmr_expire_process (whose completion we may have to wait in
del_timer_sync) and mroute_clean_tables internally use mfc_unres_lock
or other synchronizations when needed, and they both only modify mrt.

Tested in Linux 3.4.8.

Signed-off-by: Francesco Ruggeri <fruggeri@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-02 09:47:22 -07:00
..
netfilter net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-15 18:31:35 -07:00
af_inet.c net: bind() fix error return on wrong address family 2011-07-04 21:37:41 -07:00
ah4.c ah: Don't return NET_XMIT_DROP on input. 2012-02-03 09:18:54 -08:00
arp.c net: Don't proxy arp respond if iif == rt->dst.dev if private VLAN is disabled 2012-02-29 16:34:06 -08:00
cipso_ipv4.c cipso: don't follow a NULL pointer when setsockopt() is called 2012-08-09 08:27:52 -07:00
datagram.c ipv4: Lock socket and use cork flow in ip4_datagram_connect(). 2011-05-08 13:48:57 -07:00
devinet.c ipv4: flush route cache after change accept_local 2012-01-06 14:14:09 -08:00
esp4.c xfrm: take net hdr len into account for esp payload size calculation 2012-06-10 00:33:03 +09:00
fib_frontend.c Disable rp_filter for IPsec packets 2011-04-10 18:50:59 -07:00
fib_lookup.h ipv4: Fix nexthop caching wrt. scoping. 2011-03-24 18:06:47 -07:00
fib_rules.c ipv4: Use flowi4 in FIB layer. 2011-03-12 15:08:49 -08:00
fib_semantics.c ipv4: fix the rcu race between free_fib_info and ip_route_output_slow 2012-06-10 00:33:02 +09:00
fib_trie.c ipv4: Do not use dead fib_info entries. 2012-06-10 00:33:02 +09:00
gre.c gre: fix improper error handling 2011-08-15 18:31:39 -07:00
icmp.c icmp: Fix regression in nexthop resolution during replies. 2011-08-15 18:31:37 -07:00
igmp.c igmp: Avoid zero delay when receiving odd mixture of IGMP queries 2012-01-12 11:35:41 -08:00
inet_connection_sock.c seqlock: Get rid of SEQLOCK_UNLOCKED 2011-05-24 15:22:17 +02:00
inet_diag.c inet_diag: fix inet_diag_bc_audit() 2011-06-17 16:25:39 -04:00
inet_fragment.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
inet_hashtables.c net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-15 18:31:35 -07:00
inet_lro.c inet: constify ip headers and in6_addr 2011-04-22 11:04:14 -07:00
inet_timewait_sock.c tcp: fix inet_twsk_deschedule() 2011-02-19 18:59:04 -08:00
inetpeer.c net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-15 18:31:35 -07:00
ip_forward.c ipv4: Save nexthop address of LSRR/SSRR option to IPCB. 2012-02-29 16:34:02 -08:00
ip_fragment.c ipv4: Don't use enums as bitmasks in ip_fragment.c 2011-05-17 17:28:02 -04:00
ip_gre.c net: fix NULL dereferences in check_peer_redir() 2012-02-13 11:06:13 -08:00
ip_input.c inet: constify ip headers and in6_addr 2011-04-22 11:04:14 -07:00
ip_options.c ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr. 2012-02-29 16:34:03 -08:00
ip_output.c net: fix NULL dereferences in check_peer_redir() 2012-02-13 11:06:13 -08:00
ip_sockglue.c inet: add RCU protection to inet->opt 2011-04-28 13:16:35 -07:00
ipcomp.c inet: constify ip headers and in6_addr 2011-04-22 11:04:14 -07:00
ipconfig.c net: have ipconfig not wait if no dev is available 2012-01-06 14:14:08 -08:00
ipip.c ipip, sit: copy parms.name after register_netdevice 2012-01-06 14:13:45 -08:00
ipmr.c net: ipv4: ipmr_expire_timer causes crash when removing net namespace 2012-10-02 09:47:22 -07:00
Kconfig ipv4: Remove fib_hash. 2011-02-01 15:35:25 -08:00
Makefile net: ipv4: add IPPROTO_ICMP socket kind 2011-05-13 16:08:13 -04:00
netfilter.c netfilter: TCP and raw fix for ip_route_me_harder 2011-10-03 11:40:53 -07:00
ping.c ipv4, ping: Remove duplicate icmp.h include 2011-06-20 13:04:38 -07:00
proc.c tcp: Replace time wait bucket msg by counter 2010-12-08 12:16:33 -08:00
protocol.c net: add __rcu annotations to protocol 2010-10-27 11:37:31 -07:00
raw.c net: convert %p usage to %pK 2011-05-24 01:13:12 -04:00
route.c ipv4: fix redirect handling 2012-02-29 16:34:18 -08:00
syncookies.c tcp: fix syncookie regression 2012-03-23 11:20:51 -07:00
sysctl_net_ipv4.c net: ping: fix build failure 2011-05-17 14:16:58 -04:00
tcp_bic.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_cong.c tcp: Apply device TSO segment limit earlier 2012-10-02 09:47:04 -07:00
tcp_cubic.c tcp_cubic: limit delayed_ack ratio to prevent divide error 2011-05-08 15:51:57 -07:00
tcp_diag.c
tcp_highspeed.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_htcp.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_hybla.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_illinois.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_input.c tcp: perform DMA to userspace only if there is a task waiting for it 2012-08-09 08:27:52 -07:00
tcp_ipv4.c tcp: fix syncookie regression 2012-03-23 11:20:51 -07:00
tcp_lp.c Fix common misspellings 2011-03-31 11:26:23 -03:00
tcp_minisocks.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-12-08 13:47:38 -08:00
tcp_output.c tcp: Apply device TSO segment limit earlier 2012-10-02 09:47:04 -07:00
tcp_probe.c net: ipv4: tcp_probe: cleanup snprintf() use 2010-11-17 12:27:46 -08:00
tcp_scalable.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_timer.c tcp: Remove debug macro of TCP_CHECK_TIMER 2011-02-20 11:10:14 -08:00
tcp_vegas.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_vegas.h
tcp_veno.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_westwood.c tcp: mark tcp_congestion_ops read_mostly 2011-03-10 00:40:17 -08:00
tcp_yeah.c Fix common misspellings 2011-03-31 11:26:23 -03:00
tcp.c tcp: Apply device TSO segment limit earlier 2012-10-02 09:47:04 -07:00
tunnel4.c tunnels: add __rcu annotations 2010-10-27 11:37:32 -07:00
udp_impl.h
udp.c net: refine {udp|tcp|sctp}_mem limits 2011-07-07 00:27:05 -07:00
udplite.c net: fix nulls list corruptions in sk_prot_alloc 2010-12-16 14:26:56 -08:00
xfrm4_input.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
xfrm4_mode_beet.c ipsec: be careful of non existing mac headers 2012-03-19 08:57:45 -07:00
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c ipsec: be careful of non existing mac headers 2012-03-19 08:57:45 -07:00
xfrm4_output.c xfrm4: Don't call icmp_send on local error 2011-07-01 17:33:19 -07:00
xfrm4_policy.c ipv4: fix ipsec forward performance regression 2011-11-11 09:36:25 -08:00
xfrm4_state.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-3.6 2011-05-11 14:26:58 -04:00
xfrm4_tunnel.c net: struct xfrm_tunnel in read_mostly section 2010-08-30 13:50:45 -07:00