linux/net
Patrick McHardy 85670cc1fa [NET_SCHED]: Fix fallout from dev->qdisc RCU change
The move of qdisc destruction to a rcu callback broke locking in the
entire qdisc layer by invalidating previously valid assumptions about
the context in which changes to the qdisc tree occur.

The two assumptions were:

- since changes only happen in process context, read_lock doesn't need
  bottem half protection. Now invalid since destruction of inner qdiscs,
  classifiers, actions and estimators happens in the RCU callback unless
  they're manually deleted, resulting in dead-locks when read_lock in
  process context is interrupted by write_lock_bh in bottem half context.

- since changes only happen under the RTNL, no additional locking is
  necessary for data not used during packet processing (f.e. u32_list).
  Again, since destruction now happens in the RCU callback, this assumption
  is not valid anymore, causing races while using this data, which can
  result in corruption or use-after-free.

Instead of "fixing" this by disabling bottem halfs everywhere and adding
new locks/refcounting, this patch makes these assumptions valid again by
moving destruction back to process context. Since only the dev->qdisc
pointer is protected by RCU, but ->enqueue and the qdisc tree are still
protected by dev->qdisc_lock, destruction of the tree can be performed
immediately and only the final free needs to happen in the rcu callback
to make sure dev_queue_xmit doesn't access already freed memory.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-09-28 18:01:50 -07:00
..
802 [TR]: endiannness annotations 2006-09-28 17:53:59 -07:00
8021q
appletalk [ATALK]: endianness annotations 2006-09-28 17:53:58 -07:00
atm [ATM]: use NIPQUAD instead of open-coding it 2006-09-28 17:54:00 -07:00
ax25
bluetooth [Bluetooth] Support create connection cancel command 2006-09-28 18:01:33 -07:00
bridge [NETFILTER]: kill listhelp.h 2006-09-22 15:19:45 -07:00
core [NET_SCHED]: Fix fallout from dev->qdisc RCU change 2006-09-28 18:01:50 -07:00
dccp [IPV4]: ip_route_connect() ipv4 address arguments annotated 2006-09-28 17:54:06 -07:00
decnet [NET]: Fix sk->sk_filter field access 2006-09-22 15:18:47 -07:00
econet
ethernet [ETH]: indentation and cleanup 2006-09-22 14:55:09 -07:00
ieee80211 [PATCH] bcm43xx: WE-21 support 2006-09-25 16:52:16 -04:00
ipv4 [IPV4]: Fix order in inet_init failure path. 2006-09-28 18:01:48 -07:00
ipv6 [IPV4]: inet_addr_type() annotations 2006-09-28 18:01:07 -07:00
ipx [IPX]: Fix typo, ipxhdr() --> ipx_hdr() 2006-08-09 17:36:15 -07:00
irda
key [XFRM] POLICY: Support netlink socket interface for sub policy. 2006-09-22 15:08:35 -07:00
lapb
llc [LLC]: multicast receive device match 2006-08-13 18:56:26 -07:00
netfilter [NETFILTER]: xt_limit: add compat conversion functions 2006-09-22 15:20:06 -07:00
netlabel [NetLabel]: update docs with website information 2006-09-25 15:57:13 -07:00
netlink [GENL]: Provide more information to userspace about registered genl families 2006-09-22 15:18:51 -07:00
netrom
packet [NET]: Fix sk->sk_filter field access 2006-09-22 15:18:47 -07:00
rose
rxrpc
sched [NET_SCHED]: Fix fallout from dev->qdisc RCU change 2006-09-28 18:01:50 -07:00
sctp [IPV6] ADDRCONF: Convert addrconf_lock to RCU. 2006-09-22 15:20:26 -07:00
sunrpc [SUNRPC]: more sunrpc endianness annotations 2006-09-28 18:01:22 -07:00
tipc
unix [AF_UNIX]: Change max_dgram_qlen sysctl to __read_mostly 2006-09-22 15:18:42 -07:00
wanrouter
x25
xfrm [XFRM]: Fix wildcard as tunnel source 2006-09-22 15:19:06 -07:00
compat.c
Kconfig [NET] Kconfig: fix cut/paste error in TCPPROBE 2006-09-28 17:53:57 -07:00
Makefile [NetLabel]: core NetLabel subsystem 2006-09-22 14:53:34 -07:00
nonet.c
socket.c [NET]: Change somaxconn sysctl to __read_mostly 2006-09-22 15:18:41 -07:00
sysctl_net.c
TUNABLE