summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-09-17 11:11:46 -0700
committerDavid S. Miller <davem@davemloft.net>2014-09-19 17:05:45 -0400
commit4e2840eee6b21cb5230bd7cac8407badb201aac3 (patch)
tree9ff835e7c6d75beb754d1992b2bb24b7a6359567 /net/sched
parentab34f6480806263d7b4d00fa06d3647bac73b68c (diff)
downloadop-kernel-dev-4e2840eee6b21cb5230bd7cac8407badb201aac3.zip
op-kernel-dev-4e2840eee6b21cb5230bd7cac8407badb201aac3.tar.gz
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: John Fastabend <john.r.fastabend@intel.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_u32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index eceeb04..730edb2 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -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 {
OpenPOWER on IntegriCloud