diff options
author | Martin KaFai Lau <kafai@fb.com> | 2019-03-12 20:23:09 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-03-13 22:04:35 +0300 |
commit | b55aa7b04bb42274b4a894020b5b2fa059c3527e (patch) | |
tree | 32f0c9d89a04f571a0ee340c4d20c262a6201986 /tools/testing/selftests/bpf/verifier/sock.c | |
parent | ef776a272b093fb52612e6d8f4b3e77f9bb49554 (diff) | |
download | linux-b55aa7b04bb42274b4a894020b5b2fa059c3527e.tar.xz |
bpf: Test ref release issue in bpf_tcp_sock and bpf_sk_fullsock
Adding verifier tests to ensure the ptr returned from bpf_tcp_sock() and
bpf_sk_fullsock() cannot be accessed after bpf_sk_release() is called.
A few of the tests are derived from a reproducer test by Lorenz Bauer.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/verifier/sock.c')
-rw-r--r-- | tools/testing/selftests/bpf/verifier/sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/verifier/sock.c b/tools/testing/selftests/bpf/verifier/sock.c index 0ddfdf76aba5..416436231fab 100644 --- a/tools/testing/selftests/bpf/verifier/sock.c +++ b/tools/testing/selftests/bpf/verifier/sock.c @@ -342,7 +342,7 @@ }, .prog_type = BPF_PROG_TYPE_SCHED_CLS, .result = REJECT, - .errstr = "type=sock_common expected=sock", + .errstr = "reference has not been acquired before", }, { "bpf_sk_release(bpf_sk_fullsock(skb->sk))", @@ -380,5 +380,5 @@ }, .prog_type = BPF_PROG_TYPE_SCHED_CLS, .result = REJECT, - .errstr = "type=tcp_sock expected=sock", + .errstr = "reference has not been acquired before", }, |