]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: fix struct tc_u_hnode layout in u32
authorWANG Cong <xiyou.wangcong@gmail.com>
Tue, 10 Mar 2015 00:03:40 +0000 (17:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2015 03:44:31 +0000 (23:44 -0400)
commit68fc0af768c9289a7e13442b7cf588d5d8b58324
treee2d972ae0d8199cd874e80fcaba18f2ecc533778
parent14f3ae614e483679b4e292f1c87354df39270508
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: 1bc77df8f70d ("net: sched: make cls_u32 lockless")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_u32.c