net_sched: fix struct tc_u_hnode layout in u32
authorWANG Cong <[email protected]>
Tue, 10 Mar 2015 00:03:40 +0000 (17:03 -0700)
committerDavid S. Miller <[email protected]>
Tue, 10 Mar 2015 03:44:31 +0000 (23:44 -0400)
commit5778d39d070b4ac5f889928175b7f2d53ae7504e
treee2d972ae0d8199cd874e80fcaba18f2ecc533778
parentaffb8172de395a6e1db52ed9790ca0456d8c29a9
net_sched: fix struct tc_u_hnode layout in u32

We dynamically allocate divisor+1 entries for ->ht[] in tc_u_hnode:

  ht = kzalloc(sizeof(*ht) + divisor*sizeof(void *), GFP_KERNEL);

So ->ht is supposed to be the last field of this struct, however
this is broken, since an rcu head is appended after it.

Fixes: 1ce87720d456 ("net: sched: make cls_u32 lockless")
Cc: Jamal Hadi Salim <[email protected]>
Cc: John Fastabend <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/sched/cls_u32.c