linux-hardened/net
Eric W. Biederman 0a36b345ab net: Don't leak packets when a netns is going down
I have been tracking for a while a case where when the
network namespace exits the cleanup gets stck in an
endless precessess of:

unregister_netdevice: waiting for lo to become free. Usage count = 3
unregister_netdevice: waiting for lo to become free. Usage count = 3
unregister_netdevice: waiting for lo to become free. Usage count = 3
unregister_netdevice: waiting for lo to become free. Usage count = 3
unregister_netdevice: waiting for lo to become free. Usage count = 3
unregister_netdevice: waiting for lo to become free. Usage count = 3
unregister_netdevice: waiting for lo to become free. Usage count = 3

It turns out that if you listen on a multicast address an unsubscribe
packet is sent when the network device goes down.   If you shutdown
the network namespace without carefully cleaning up this can trigger
the unsubscribe packet to be sent over the loopback interface while
the network namespace is going down.

All of which is fine except when we drop the packet and forget to
free it leaking the skb and the dst entry attached to.  As it
turns out the dst entry hold a reference to the idev which holds
the dev and keeps everything from being cleaned up.  Yuck!

By fixing my earlier thinko and add the needed kfree_skb and everything
cleans up beautifully. 

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-05 16:00:24 -08:00
..
9p net: remove two duplicated #include 2008-11-03 18:23:09 -08:00
802 net: '&' redux 2008-11-03 18:21:05 -08:00
8021q net/: Kill now superfluous ->last_rx stores. 2008-11-03 22:01:07 -08:00
appletalk net: '&' redux 2008-11-03 18:21:05 -08:00
atm net: replace NIPQUAD() in net/*/ 2008-10-31 00:54:56 -07:00
ax25 net: '&' redux 2008-11-03 18:21:05 -08:00
bluetooth net/: Kill now superfluous ->last_rx stores. 2008-11-03 22:01:07 -08:00
bridge net: '&' redux 2008-11-03 18:21:05 -08:00
can net: Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely) 2008-10-16 15:24:51 -07:00
core net: Don't leak packets when a netns is going down 2008-11-05 16:00:24 -08:00
dccp dccp: Cleanup routines for feature negotiation 2008-11-04 23:56:30 -08:00
decnet net: '&' redux 2008-11-03 18:21:05 -08:00
dsa net/: Kill now superfluous ->last_rx stores. 2008-11-03 22:01:07 -08:00
econet netns: Use net_eq() to compare net-namespaces for optimization. 2008-07-19 22:34:43 -07:00
ethernet dsa: add support for Trailer tagging format 2008-10-08 17:24:16 -07:00
ieee80211 net/: Kill now superfluous ->last_rx stores. 2008-11-03 22:01:07 -08:00
ipv4 net: '&' redux 2008-11-03 18:21:05 -08:00
ipv6 net: '&' redux 2008-11-03 18:21:05 -08:00
ipx net: '&' redux 2008-11-03 18:21:05 -08:00
irda net: '&' redux 2008-11-03 18:21:05 -08:00
iucv iucv: Fix mismerge again. 2008-09-30 03:03:35 -07:00
key af_key: fix SADB_X_SPDDELETE response 2008-10-10 14:07:03 -07:00
lapb
llc net: '&' redux 2008-11-03 18:21:05 -08:00
mac80211 mac80211: fix two kernel-doc warnings 2008-10-31 19:02:36 -04:00
netfilter net: '&' redux 2008-11-03 18:21:05 -08:00
netlabel net: replace NIPQUAD() in net/*/ 2008-10-31 00:54:56 -07:00
netlink netlink: constify struct nlattr * arg to parsing functions 2008-10-28 11:59:11 -07:00
netrom net: '&' redux 2008-11-03 18:21:05 -08:00
packet net: convert BUG_TRAP to generic WARN_ON 2008-07-25 21:43:18 -07:00
phonet net: '&' redux 2008-11-03 18:21:05 -08:00
rfkill rfkill: rate-limit rfkill-input workqueue usage (v3) 2008-10-31 19:00:10 -04:00
rose net: '&' redux 2008-11-03 18:21:05 -08:00
rxrpc net: replace NIPQUAD() in net/*/ 2008-10-31 00:54:56 -07:00
sched netem: eliminate unneeded return values 2008-11-03 21:13:26 -08:00
sctp net: '&' redux 2008-11-03 18:21:05 -08:00
sunrpc sunrpc: Fix build warning due to typo in %pI4 format changes. 2008-11-02 23:57:06 -08:00
tipc net: convert print_mac to %pM 2008-10-27 17:06:18 -07:00
unix net: '&' redux 2008-11-03 18:21:05 -08:00
wanrouter wanmain.c doesn't need syncppp.h 2008-07-23 23:00:36 +02:00
wireless wireless regulatory: move ignore_request 2008-10-31 19:02:32 -04:00
x25 net: '&' redux 2008-11-03 18:21:05 -08:00
xfrm net: replace NIPQUAD() in net/*/ 2008-10-31 00:54:56 -07:00
compat.c flag parameters: paccept 2008-07-24 10:47:27 -07:00
Kconfig netns: Coexist with the sysfs limitations v2 2008-10-27 17:51:47 -07:00
Makefile net: Distributed Switch Architecture protocol support 2008-10-08 17:15:19 -07:00
nonet.c
socket.c net: remove two duplicated #include 2008-11-03 18:23:09 -08:00
sysctl_net.c missing bits of net-namespace / sysctl 2008-07-27 09:45:34 -07:00
TUNABLE