linux/net/sched
Eric Dumazet 5d944c640b gen_estimator: deadlock fix
One of my test machine got a deadlock during "tc" sessions,
adding/deleting classes & filters, using traffic estimators.

After some analysis, I believe we have a potential use after free case
in est_timer() :

spin_lock(e->stats_lock); << HERE >>
read_lock(&est_lock);
if (e->bstats == NULL)   << TEST >>
	goto skip;

Test is done a bit late, because after estimator is killed, and before
rcu grace period elapsed, we might already have freed/reuse memory where
e->stats_locks points to (some qdisc->q.lock)

A possible fix is to respect a rcu grace period at Qdisc dismantle time.

On 64bit, sizeof(struct Qdisc) is exactly 192 bytes. Adding 16 bytes to
it (for struct rcu_head) is a problem because it might change
performance, given QDISC_ALIGNTO is 32 bytes.

This is why I also change QDISC_ALIGNTO to 64 bytes, to satisfy most
current alignment requirements.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-01 18:38:48 -07:00
..
act_api.c net_sched: make traffic control network namespace aware 2010-03-22 20:26:25 -07:00
act_gact.c tc: propogate errors from tcf_hash_create 2008-11-25 21:13:25 -08:00
act_ipt.c tc: propogate errors from tcf_hash_create 2008-11-25 21:13:25 -08:00
act_mirred.c net: rename skb->iif to skb->skb_iif 2009-11-20 15:35:04 -08:00
act_nat.c tc: propogate errors from tcf_hash_create 2008-11-25 21:13:25 -08:00
act_pedit.c pkt_sched: pedit use proper struct 2009-10-11 23:03:47 -07:00
act_police.c pkt_sched: Update drops stats in act_police 2009-06-17 18:56:45 -07:00
act_simple.c tc: propogate errors from tcf_hash_create 2008-11-25 21:13:25 -08:00
act_skbedit.c pkt_sched: skbedit add support for setting mark 2009-10-22 21:56:42 -07:00
cls_api.c net_sched: make traffic control network namespace aware 2010-03-22 20:26:25 -07:00
cls_basic.c pkt_sched: remove unnecessary xchg() in packet classifiers 2008-11-20 04:14:28 -08:00
cls_cgroup.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
cls_flow.c net: rename skb->iif to skb->skb_iif 2009-11-20 15:35:04 -08:00
cls_fw.c pkt_sched: remove unnecessary xchg() in packet classifiers 2008-11-20 04:14:28 -08:00
cls_route.c net: skb->dst accessors 2009-06-03 02:51:04 -07:00
cls_rsvp6.c
cls_rsvp.c
cls_rsvp.h net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
cls_tcindex.c pkt_sched: remove unnecessary xchg() in packet classifiers 2008-11-20 04:14:28 -08:00
cls_u32.c net: remove trailing space in messages 2010-03-24 14:01:54 -07:00
em_cmp.c net: em_cmp.c use unaligned access helpers 2008-09-22 19:20:51 -07:00
em_meta.c netsched: Allow var_sk_bound_if meta to work on all namespaces 2009-11-18 23:24:41 -08:00
em_nbyte.c
em_text.c [NET_SCHED]: Convert classifiers from rtnetlink to new netlink API 2008-01-28 15:11:11 -08:00
em_u32.c [PKT_SCHED]: annotate cls_u32 2008-03-17 22:46:46 -07:00
ematch.c ematch: simpler tcf_em_unregister() 2008-11-16 23:01:49 -08:00
Kconfig net/sched: Fix module name in Kconfig 2010-02-08 22:41:44 -08:00
Makefile net_sched: add classful multiqueue dummy scheduler 2009-09-06 02:07:05 -07:00
sch_api.c net_sched: minor netns related cleanup 2010-03-30 19:44:56 -07:00
sch_atm.c net: restore gnet_stats_basic to previous definition 2009-08-17 21:33:49 -07:00
sch_blackhole.c pkt_sched: Add qdisc->ops->peek() implementation. 2008-10-31 00:45:55 -07:00
sch_cbq.c pkt_sched: gen_estimator: Dont report fake rate estimators 2009-10-07 01:07:42 -07:00
sch_drr.c pkt_sched: gen_estimator: Dont report fake rate estimators 2009-10-07 01:07:42 -07:00
sch_dsmark.c pkt_sched: remove unnecessary xchg() in packet schedulers 2008-11-20 04:11:36 -08:00
sch_fifo.c sched: add head drop fifo queue 2010-01-28 21:27:00 -08:00
sch_generic.c gen_estimator: deadlock fix 2010-04-01 18:38:48 -07:00
sch_gred.c pkt_sched: Remove qdisc->ops->requeue() etc. 2008-11-13 22:56:30 -08:00
sch_hfsc.c pkt_sched: gen_estimator: Dont report fake rate estimators 2009-10-07 01:07:42 -07:00
sch_htb.c net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
sch_ingress.c net_sched: make cls_ops->change and cls_ops->delete optional 2009-09-06 02:07:02 -07:00
sch_mq.c pkt_sched: Fix qstats.qlen updating in dump_stats 2009-09-17 10:26:07 -07:00
sch_multiq.c pkt_sched: Fix qstats.qlen updating in dump_stats 2009-09-17 10:26:07 -07:00
sch_netem.c net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
sch_prio.c pkt_sched: Fix qstats.qlen updating in dump_stats 2009-09-17 10:26:07 -07:00
sch_red.c net_sched: remove some unnecessary checks in classful schedulers 2009-09-06 02:07:02 -07:00
sch_sfq.c net_sched: make cls_ops->change and cls_ops->delete optional 2009-09-06 02:07:02 -07:00
sch_tbf.c net_sched: remove some unnecessary checks in classful schedulers 2009-09-06 02:07:02 -07:00
sch_teql.c net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00