Commit 4e2840ee authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

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)

CC: Eric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ab34f648
...@@ -64,8 +64,11 @@ struct tc_u_knode { ...@@ -64,8 +64,11 @@ struct tc_u_knode {
u32 __percpu *pcpu_success; u32 __percpu *pcpu_success;
#endif #endif
struct tcf_proto *tp; struct tcf_proto *tp;
struct tc_u32_sel sel;
struct rcu_head rcu; 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 { struct tc_u_hnode {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment