net: sched: cls_u32: rcu can not be last node
Subsystems (3)
PATCH v3 1/1 net: sched: cls_u32: rcu can not be last node
tc_u32_sel 'sel' in tc_u_knode expects to be the last element in the structure and pads the structure with tc_u32_key fields for each key.
kzalloc(sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key), GFP_KERNEL)
--- net/sched/cls_u32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/sched/cls_u32.c +4 -1
@@ -64,8 +64,11 @@ struct tc_u_knode {u32 __percpu *pcpu_success;#endif struct tcf_proto *tp; -struct tc_u32_sel sel;struct rcu_head rcu; +/* The 'sel' field MUST be the last field in structure to allow for +* tc_u32_keys allocated at end of structure. +*/ +struct tc_u32_sel sel; };struct tc_u_hnode {
Quoted 10 lines · John Fastabend
tc_u32_sel'sel' intc_u_knodeexpects to be the last element in the structure and pads the structure withtc_u32_keyfields for each key.
kzalloc(sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key), GFP_KERNEL)CC Eric Dumazet <[email protected]>Signed-off-by John Fastabend <[email protected]>--- net/sched/cls_u32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Thanks John !
From: John Fastabend <[email protected]>
Date: Wed, 17 Sep 2014 11:11:46 -0700
Quoted 7 lines
tc_u32_sel'sel' intc_u_knodeexpects to be the last element in the structure and pads the structure withtc_u32_keyfields for each key.
kzalloc(sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key), GFP_KERNEL)CC Eric Dumazet <[email protected]>Signed-off-by John Fastabend <[email protected]>
Applied, thanks John.