Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd3e646c authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller
Browse files

net: act_bpf: fix size mismatch on filter preparation

Similarly as in cls_bpf, also this code needs to reject mismatches.

Reference: http://article.gmane.org/gmane.linux.network/347406


Fixes: d23b8ad8 ("tc: add BPF based action")
Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c1bc6bd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -122,6 +122,9 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
		return -EINVAL;

	bpf_size = bpf_num_ops * sizeof(*bpf_ops);
	if (bpf_size != nla_len(tb[TCA_ACT_BPF_OPS]))
		return -EINVAL;

	bpf_ops = kzalloc(bpf_size, GFP_KERNEL);
	if (!bpf_ops)
		return -ENOMEM;