History log of /external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2b36047e7889b7efee22c11e17f035f721855731 06-Jan-2018 Alexei Starovoitov <ast@fb.com> selftests/bpf: fix test_align

since commit 82abbf8d2fc4 the verifier rejects the bit-wise
arithmetic on pointers earlier.
The test 'dubious pointer arithmetic' now has less output to match on.
Adjust it.

Fixes: 82abbf8d2fc4 ("bpf: do not allow root to mangle valid pointers")
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
f999d64c346c0154e7ed4beb0eba7d2eed422a34 07-Aug-2017 Edward Cree <ecree@solarflare.com> selftests/bpf: add tests for subtraction & negative numbers

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
c2c3e11712e23d430a49e1247a8ec211740c2254 07-Aug-2017 Edward Cree <ecree@solarflare.com> selftests/bpf: add test for bogus operations on pointers

Tests non-add/sub operations (AND, LSH) on pointers decaying them to
unknown scalars.
Also tests that a pkt_ptr add which could potentially overflow is rejected
(find_good_pkt_pointers ignores it and doesn't give us any reg->range).

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
715dddb5e640bd24ce46dc7885c9657038ad1e23 07-Aug-2017 Edward Cree <ecree@solarflare.com> selftests/bpf: add a test to test_align

New test adds 14 to the unknown value before adding to the packet pointer,
meaning there's no 'fixed offset' field and instead we add into the
var_off, yielding a '4n+2' value.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
9fafa80513d922ed80c2067a3ea636696fc14c61 07-Aug-2017 Edward Cree <ecree@solarflare.com> selftests/bpf: rewrite test_align

Expectations have changed, as has the format of the logged state.
To make the tests easier to read, add a line-matching framework so that
each match need only quote the register it cares about. (Multiple
matches may refer to the same line, but matches must be listed in
order of increasing line.)

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
d655490417ee22da3267fe6592a0ec2023c3c0db 21-Jul-2017 Daniel Borkmann <daniel@iogearbox.net> bpf: allow to specify log level and reduce it for test_verifier

For the test_verifier case, it's quite hard to parse log level 2 to
figure out what's causing an issue when used to log level 1. We do
want to use bpf_verify_program() in order to simulate some of the
tests with strict alignment. So just add an argument to pass the level
and put it to 1 for test_verifier.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
efe5f9c0a7beb91efd8405468f19bbd6802e4e5d 13-Jun-2017 Jesper Dangaard Brouer <brouer@redhat.com> selftests/bpf: make correct use of exit codes in bpf selftests

The selftests depend on using the shell exit code as a mean of
detecting the success or failure of test-binary executed. The
appropiate output "[PASS]" or "[FAIL]" in generated by
tools/testing/selftests/lib.mk.

Notice that the exit code is masked with 255. Thus, be careful if
using the number of errors as the exit code, as 256 errors would be
seen as a success.

There are two standard defined exit(3) codes:
/usr/include/stdlib.h
#define EXIT_FAILURE 1 /* Failing exit status. */
#define EXIT_SUCCESS 0 /* Successful exit status. */

Fix test_verifier.c to not use the negative value of variable
"results", but instead return EXIT_FAILURE.

Fix test_align.c and test_progs.c to actually use exit codes, before
they were always indicating success regardless of results.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
f735b64926da36aadc0737d29dde587ac1e2e2c2 11-Jun-2017 Daniel Borkmann <daniel@iogearbox.net> bpf, tests: set rlimit also for test_align, so it doesn't fail

When running all the tests, through 'make run_tests', I had
test_align failing due to insufficient rlimit. Set it the same
way as all other test cases from BPF selftests do, so that
test case properly loads everything.

[...]
Summary: 7 PASSED, 1 FAILED
selftests: test_progs [PASS]
/home/foo/net-next/tools/testing/selftests/bpf
Test 0: mov ... Failed to load program.
FAIL
Test 1: shift ... Failed to load program.
FAIL
Test 2: addsub ... Failed to load program.
FAIL
Test 3: mul ... Failed to load program.
FAIL
Test 4: unknown shift ... Failed to load program.
FAIL
Test 5: unknown mul ... Failed to load program.
FAIL
Test 6: packet const offset ... Failed to load program.
FAIL
Test 7: packet variable offset ... Failed to load program.
FAIL
Results: 0 pass 8 fail
selftests: test_align [PASS]
[...]

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
6832a333ed4a7cc4fcb170c045d1d96d0976fdd4 12-May-2017 David S. Miller <davem@davemloft.net> bpf: Handle multiple variable additions into packet pointers in verifier.

We must accumulate into reg->aux_off rather than use a plain assignment.

Add a test for this situation to test_align.

Reported-by: Alexei Starovoitov <ast@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
69a73e744db1a57175039e3d1e6ef3913e816eb8 12-May-2017 David S. Miller <davem@davemloft.net> bpf: Remove commented out debugging hack in test_align.

Reported-by: Alexander Alemayhu <alexander@alemayhu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c
18b3ad90b64e9893297357608abddd26170730eb 10-May-2017 David S. Miller <davem@davemloft.net> bpf: Add verifier test case for alignment.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
/external/linux-kselftest/tools/testing/selftests/bpf/test_align.c