hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/testing/selftests/bpf/test_verifier.c
....@@ -50,7 +50,7 @@
5050 #define MAX_INSNS BPF_MAXINSNS
5151 #define MAX_TEST_INSNS 1000000
5252 #define MAX_FIXUPS 8
53
-#define MAX_NR_MAPS 20
53
+#define MAX_NR_MAPS 21
5454 #define MAX_TEST_RUNS 8
5555 #define POINTER_VALUE 0xcafe4all
5656 #define TEST_DATA_LEN 64
....@@ -87,6 +87,7 @@
8787 int fixup_sk_storage_map[MAX_FIXUPS];
8888 int fixup_map_event_output[MAX_FIXUPS];
8989 int fixup_map_reuseport_array[MAX_FIXUPS];
90
+ int fixup_map_ringbuf[MAX_FIXUPS];
9091 const char *errstr;
9192 const char *errstr_unpriv;
9293 uint32_t insn_processed;
....@@ -640,6 +641,7 @@
640641 int *fixup_sk_storage_map = test->fixup_sk_storage_map;
641642 int *fixup_map_event_output = test->fixup_map_event_output;
642643 int *fixup_map_reuseport_array = test->fixup_map_reuseport_array;
644
+ int *fixup_map_ringbuf = test->fixup_map_ringbuf;
643645
644646 if (test->fill_helper) {
645647 test->fill_insns = calloc(MAX_TEST_INSNS, sizeof(struct bpf_insn));
....@@ -817,6 +819,14 @@
817819 fixup_map_reuseport_array++;
818820 } while (*fixup_map_reuseport_array);
819821 }
822
+ if (*fixup_map_ringbuf) {
823
+ map_fds[20] = create_map(BPF_MAP_TYPE_RINGBUF, 0,
824
+ 0, 4096);
825
+ do {
826
+ prog[*fixup_map_ringbuf].imm = map_fds[20];
827
+ fixup_map_ringbuf++;
828
+ } while (*fixup_map_ringbuf);
829
+ }
820830 }
821831
822832 struct libcap {