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
..
2010-01-07 00:24:55 -08:00
2010-03-21 18:34:16 -07:00
2009-11-04 05:06:25 -08:00
2009-09-01 17:40:57 -07:00
2009-11-04 05:06:25 -08:00
2009-03-21 19:06:54 -07:00
2009-09-01 17:40:31 -07:00
2008-11-25 17:35:18 -08:00
2008-07-05 21:26:57 -07:00
2009-11-04 05:06:25 -08:00
2009-11-04 05:06:25 -08:00
2009-11-13 20:46:58 -08:00
2008-06-11 21:00:38 -07:00
2009-11-04 05:06:25 -08:00
2009-11-04 05:06:25 -08:00
2009-12-26 20:46:28 -08:00
2010-03-12 15:52:40 -08:00
2009-01-06 11:38:15 -07:00
2010-01-16 01:04:04 -08:00
2009-11-20 15:35:04 -08:00
2010-04-01 18:38:48 -07:00
2009-03-21 19:06:50 -07:00
2009-11-04 05:06:25 -08:00
2009-07-26 19:11:14 -07:00
2010-04-01 18:38:48 -07:00
2009-11-04 05:06:25 -08:00
2010-03-21 18:34:16 -07:00
2010-03-08 10:45:26 -08:00
2008-07-05 21:25:39 -07:00
2009-11-10 20:54:38 -08:00
2009-10-07 16:39:43 -04:00
2009-11-29 00:24:59 -08:00
2010-03-03 01:04:37 -08:00