lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231015232953.84836-6-hengqi.chen@gmail.com>
Date:   Sun, 15 Oct 2023 23:29:53 +0000
From:   Hengqi Chen <hengqi.chen@...il.com>
To:     linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Cc:     keescook@...omium.org, ast@...nel.org, daniel@...earbox.net,
        andrii@...nel.org, luto@...capital.net, wad@...omium.org,
        alexyonghe@...cent.com, hengqi.chen@...il.com
Subject: [PATCH v2 5/5] selftests/bpf: Skip BPF_PROG_TYPE_SECCOMP-related tests

We only allow BPF_PROG_TYPE_SECCOMP progs to be loaded via
seccomp syscall. Skip related test on BPF side.

Signed-off-by: Hengqi Chen <hengqi.chen@...il.com>
---
 tools/testing/selftests/bpf/prog_tests/libbpf_probes.c | 3 ++-
 tools/testing/selftests/bpf/prog_tests/libbpf_str.c    | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c b/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c
index 9f766ddd946a..134ae042c4da 100644
--- a/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c
+++ b/tools/testing/selftests/bpf/prog_tests/libbpf_probes.c
@@ -28,7 +28,8 @@ void test_libbpf_probe_prog_types(void)
 		enum bpf_prog_type prog_type = (enum bpf_prog_type)e->val;
 		int res;
 
-		if (prog_type == BPF_PROG_TYPE_UNSPEC)
+		if (prog_type == BPF_PROG_TYPE_UNSPEC ||
+		    prog_type == BPF_PROG_TYPE_SECCOMP)
 			continue;
 
 		if (!test__start_subtest(prog_type_name))
diff --git a/tools/testing/selftests/bpf/prog_tests/libbpf_str.c b/tools/testing/selftests/bpf/prog_tests/libbpf_str.c
index c440ea3311ed..35365500c326 100644
--- a/tools/testing/selftests/bpf/prog_tests/libbpf_str.c
+++ b/tools/testing/selftests/bpf/prog_tests/libbpf_str.c
@@ -186,6 +186,9 @@ static void test_libbpf_bpf_prog_type_str(void)
 		const char *prog_type_str;
 		char buf[256];
 
+		if (prog_type == BPF_PROG_TYPE_SECCOMP)
+			continue;
+
 		prog_type_name = btf__str_by_offset(btf, e->name_off);
 		prog_type_str = libbpf_bpf_prog_type_str(prog_type);
 		ASSERT_OK_PTR(prog_type_str, prog_type_name);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ