aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/interface.c
diff options
context:
space:
mode:
authorChema Gonzalez <[email protected]>2014-05-30 17:15:12 +0000
committerDavid S. Miller <[email protected]>2014-06-02 23:32:43 +0000
commite9d9450497f77ee40c7d895bf1b5b134b9347d5f (patch)
tree5b56ae0ed1e7cc3b4ff1aaf4f41d141c026af380 /drivers/net/xen-netback/interface.c
parentMerge branch 'mvneta' (diff)
downloadkernel-e9d9450497f77ee40c7d895bf1b5b134b9347d5f.tar.gz
kernel-e9d9450497f77ee40c7d895bf1b5b134b9347d5f.zip
net: filter: fix length calculation in BPF testsuite
The current probe_filter_length() (the function that calculates the length of a test BPF filter) behavior is to declare the end of the filter as soon as it finds {0, *, *, 0}. This is actually a valid insn ("ld #0"), so any filter with includes "BPF_STMT(BPF_LD | BPF_IMM, 0)" fails (its length is cut short). We are changing probe_filter_length() so as to start from the end, and declare the end of the filter as the first instruction which is not {0, *, *, 0}. This solution produces a simpler patch than the alternative of using an explicit end-of-filter mark. It is technically incorrect if your filter ends up with "ld #0", but that should not happen anyway. We also add a new test (LD_IMM_0) that includes ld #0 (does not work without this patch). Signed-off-by: Chema Gonzalez <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
0 files changed, 0 insertions, 0 deletions