Message ID | 1427211230-18374-1-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index 13f64df2c710..87f2f1b17181 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c @@ -182,6 +182,11 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp, } bpf_size = bpf_len * sizeof(*bpf_ops); + if (bpf_size != nla_len(tb[TCA_BPF_OPS])) { + ret = -EINVAL; + goto errout; + } + bpf_ops = kzalloc(bpf_size, GFP_KERNEL); if (bpf_ops == NULL) { ret = -ENOMEM;