1
linux/net/sched
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
..
act_api.c [PKT_SCHED]: Kill pkt_act.h inlining. 2006-09-22 14:55:10 -07:00
act_gact.c [PKT_SCHED]: Kill pkt_act.h inlining. 2006-09-22 14:55:10 -07:00
act_ipt.c [NETFILTER]: x_tables: remove unused size argument to check/destroy functions 2006-09-22 14:55:34 -07:00
act_mirred.c [PKT_SCHED]: Kill pkt_act.h inlining. 2006-09-22 14:55:10 -07:00
act_pedit.c [PKT_SCHED]: Kill pkt_act.h inlining. 2006-09-22 14:55:10 -07:00
act_police.c [PKT_SCHED]: Kill pkt_act.h inlining. 2006-09-22 14:55:10 -07:00
act_simple.c [PKT_SCHED] act_simple.c: make struct simp_hash_info static 2006-09-22 15:18:40 -07:00
cls_api.c [NET_SCHED]: Fix fallout from dev->qdisc RCU change 2006-09-28 18:01:50 -07:00
cls_basic.c [PKT_SCHED] cls_basic: Use unsigned int when generating handle 2006-09-28 18:01:45 -07:00
cls_fw.c [NET_SCHED]: Add mask support to fwmark classifier 2006-09-22 15:18:12 -07:00
cls_route.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
cls_rsvp6.c
cls_rsvp.c
cls_rsvp.h [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
cls_tcindex.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
cls_u32.c [PKT_SCHED] cls_u32: Fix typo. 2006-08-17 16:29:54 -07:00
em_cmp.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
em_meta.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
em_nbyte.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
em_text.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
em_u32.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ematch.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
estimator.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
Kconfig
Makefile
sch_api.c [NET_SCHED]: Fix fallout from dev->qdisc RCU change 2006-09-28 18:01:50 -07:00
sch_atm.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_blackhole.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_cbq.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
sch_dsmark.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_fifo.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_generic.c [NET_SCHED]: Fix fallout from dev->qdisc RCU change 2006-09-28 18:01:50 -07:00
sch_gred.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
sch_hfsc.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
sch_htb.c [NET_SCHED]: HTB: fix incorrect use of RB_EMPTY_NODE 2006-09-28 18:01:49 -07:00
sch_ingress.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_netem.c [NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE 2006-09-22 14:53:53 -07:00
sch_prio.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_red.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_sfq.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_tbf.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sch_teql.c