Daniel Borkmann 3f2ab13594 net: cls_bpf: fix auto generation of per list handles
When creating a bpf classifier in tc with priority collisions and
invoking automatic unique handle assignment, cls_bpf_grab_new_handle()
will return a wrong handle id which in fact is non-unique. Usually
altering of specific filters is being addressed over major id, but
in case of collisions we result in a filter chain, where handle ids
address individual cls_bpf_progs inside the classifier.

Issue is, in cls_bpf_grab_new_handle() we probe for head->hgen handle
in cls_bpf_get() and in case we found a free handle, we're supposed
to use exactly head->hgen. In case of insufficient numbers of handles,
we bail out later as handle id 0 is not allowed.

Fixes: 7d1d65cb84e1 ("net: sched: cls_bpf: add BPF-based classifier")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-26 15:50:19 -08:00
..
2014-09-30 01:02:26 -04:00
2014-11-21 14:20:18 -05:00
2011-01-19 23:31:12 -08:00
2011-01-19 23:31:12 -08:00
2014-11-21 14:20:18 -05:00
2014-10-21 21:45:21 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-11-03 16:13:03 -05:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00
2014-09-30 01:02:26 -04:00