]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, selftests: Add various ringbuf tests with invalid offset
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 10 Jan 2022 13:44:18 +0000 (13:44 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 19 Jan 2022 00:21:49 +0000 (01:21 +0100)
commit722e4db3ae0d52b2e3801280afbe19cf2d188e91
tree97b076a0a1cd73587d5969a88fd49c89a4df066d
parenta672b2e36a648afb04ad3bda93b6bda947a479a5
bpf, selftests: Add various ringbuf tests with invalid offset

Assert that the verifier is rejecting invalid offsets on the ringbuf entries:

  # ./test_verifier | grep ring
  #947/u ringbuf: invalid reservation offset 1 OK
  #947/p ringbuf: invalid reservation offset 1 OK
  #948/u ringbuf: invalid reservation offset 2 OK
  #948/p ringbuf: invalid reservation offset 2 OK

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/verifier/ringbuf.c [new file with mode: 0644]