Skip to content

Commit 9a03abc

Browse files
committed
selftests/seccomp: Avoid using "sysctl" for report
Instead of depending on "sysctl" being installed, just use "grep -H" for sysctl status reporting. Additionally report kernel version for easier comparisons. Signed-off-by: Kees Cook <[email protected]>
1 parent 62ddb91 commit 9a03abc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/testing/selftests/seccomp/seccomp_benchmark.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@ int main(int argc, char *argv[])
145145

146146
setbuf(stdout, NULL);
147147

148+
printf("Running on:\n");
149+
system("uname -a");
150+
148151
printf("Current BPF sysctl settings:\n");
149-
system("sysctl net.core.bpf_jit_enable");
150-
system("sysctl net.core.bpf_jit_harden");
152+
/* Avoid using "sysctl" which may not be installed. */
153+
system("grep -H . /proc/sys/net/core/bpf_jit_enable");
154+
system("grep -H . /proc/sys/net/core/bpf_jit_harden");
151155

152156
if (argc > 1)
153157
samples = strtoull(argv[1], NULL, 0);

0 commit comments

Comments
 (0)