summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
diff options
context:
space:
mode:
authorUdip Pant <udippant@fb.com>2020-08-25 16:20:01 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-08-26 12:47:56 -0700
commit6dc03dc71387e1dc65cf14efb49e5cf7062a2d46 (patch)
tree46675c899ce84ed38a4d43e93796afa7ca600468 /tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
parent7e40781cc8b767dd6530910ae12d75978d7d68e1 (diff)
selftests/bpf: Add test for freplace program with write access
This adds a selftest that tests the behavior when a freplace target program attempts to make a write access on a packet. The expectation is that the read or write access is granted based on the program type of the linked program and not itself (which is of type, for e.g., BPF_PROG_TYPE_EXT). This test fails without the associated patch on the verifier. Signed-off-by: Udip Pant <udippant@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200825232003.2877030-3-udippant@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
index 197d0d217b56..7c7168963d52 100644
--- a/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
+++ b/tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
@@ -123,6 +123,7 @@ static void test_func_replace(void)
"freplace/get_skb_len",
"freplace/get_skb_ifindex",
"freplace/get_constant",
+ "freplace/test_pkt_write_access_subprog",
};
test_fexit_bpf2bpf_common("./fexit_bpf2bpf.o",
"./test_pkt_access.o",