OSDN Git Service

bpf: Add skb->sk, bpf_sk_fullsock and bpf_tcp_sock tests to test_verifer
authorMartin KaFai Lau <kafai@fb.com>
Sun, 10 Feb 2019 07:22:26 +0000 (23:22 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Feb 2019 03:46:17 +0000 (19:46 -0800)
commitfb47d1d931f8419645db15ef5fc0dc7a857c8f4e
tree84f247f2c9ef5015f545d76069493bf87674bd08
parent281f9e7572075879c0af4be792eaf31c17e7f894
bpf: Add skb->sk, bpf_sk_fullsock and bpf_tcp_sock tests to test_verifer

This patch tests accessing the skb->sk and the new helpers,
bpf_sk_fullsock and bpf_tcp_sock.

The errstr of some existing "reference tracking" tests is changed
with s/bpf_sock/sock/ and s/socket/sock/ where "sock" is from the
verifier's reg_type_str[].

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bpf_util.h
tools/testing/selftests/bpf/verifier/ref_tracking.c
tools/testing/selftests/bpf/verifier/sock.c [new file with mode: 0644]
tools/testing/selftests/bpf/verifier/unpriv.c