]> git.baikalelectronics.ru Git - kernel.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)
commit68ab3cf650b68601fddf0a8cae09e8fd793c25fc
tree97b076a0a1cd73587d5969a88fd49c89a4df066d
parent235dd1cc6ae3e76d5cba41fa24e6127223cafd36
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]