projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
net: cls_bpf: fix size mismatch on filter preparation
[cascardo/linux.git]
/
net
/
sched
/
cls_bpf.c
diff --git
a/net/sched/cls_bpf.c
b/net/sched/cls_bpf.c
index
84c8219
..
49e5fa8
100644
(file)
--- a/
net/sched/cls_bpf.c
+++ b/
net/sched/cls_bpf.c
@@
-180,6
+180,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;