Minor cls_basic, act_bpf update
Subsystems (5)
cover Minor cls_basic, act_bpf update
Daniel Borkmann (2):
net: cls_basic: return from walking on match in basic_get
net: act_bpf: fix size mismatch on filter preparation
net/sched/act_bpf.c | 3 +++ net/sched/cls_basic.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.11.7
PATCH 2/2 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
--- net/sched/act_bpf.c | 3 +++ 1 file changed, 3 insertions(+)
net/sched/act_bpf.c +3 -0
@@ -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 ;
Signature · 1 line
1.7.11.7
PATCH 1/2 net: cls_basic: return from walking on match in basic_get
In reply to Daniel BorkmannAs soon as we've found a matching handle in basic_get(), we can return it. There's no need to continue walking until the end of a filter chain, since they are unique anyway.
--- net/sched/cls_basic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/sched/cls_basic.c +5 -2
@@ -65,9 +65,12 @@ static unsigned long basic_get(struct tcf_proto *tp, u32 handle)if (head ==NULL )return 0UL ; -list_for_each_entry (f, &head->flist, link) -if (f->handle == handle) +list_for_each_entry (f, &head->flist, link) { +if (f->handle == handle) { l = (unsigned long ) f; +break ; + } + }return l; }
Signature · 1 line
1.7.11.7
Re: [PATCH net-next 1/2] net: cls_basic: return from walking on match in basic_get
Quoted 7 lines · Daniel Borkmann
As soon as we've found a matching handle in
basic_get(), we can return it. There's no need to continue walking until the end of a filter chain, since they are unique anyway.Signed-off-by Daniel Borkmann <[email protected]>Acked-by Jiri Pirko <[email protected]>Cc Thomas Graf <[email protected]>
Re: [PATCH net-next 2/2] net: act_bpf: fix size mismatch on filter preparation
In reply to Daniel BorkmannQuoted 6 lines · Daniel Borkmann
Similarly as in
cls_bpf, also this code needs to reject mismatches.Reference: http://article.gmane.org/gmane.linux.network/347406
Fixes d23b8ad8ab23 ("tc: add BPF based action")Signed-off-by Daniel Borkmann <[email protected]>Acked-by Jiri Pirko <[email protected]>
David Miller
maintainerFrom: Daniel Borkmann <[email protected]>
Date: Thu, 22 Jan 2015 10:58:17 +0100
Quoted 3 lines
Daniel Borkmann (2):
net:cls_basic: return from walking on match inbasic_get
net:act_bpf: fix size mismatch on filter preparation
Seires applied, thanks.