selftests/seccomp: fix negative_ENOSYS tracer tests on arm32
Subsystems (2)
PATCH 1/1 selftests/seccomp: fix negative_ENOSYS tracer tests on arm32
TRACE_syscall.ptrace.negative_ENOSYS and TRACE_syscall.seccomp.negative_ENOSYS on arm32 are being reported as failures instead of skipping.
The teardown_trace_fixture function sets the test to KSFT_FAIL in case of a non 0 return value from the tracer process.
Due to _metadata now being shared between the forked processes the tracer is returning the KSFT_SKIP value set by the tracee which is non 0.
Remove the setting of the _metadata.exit_code in teardown_trace_fixture.
--- tools/testing/selftests/seccomp/seccomp_bpf.c | 6 ------ 1 file changed, 6 deletions(-)
tools/testing/selftests/seccomp/seccomp_bpf.c +0 -6
@@ -1629,14 +1629,8 @@ void teardown_trace_fixture(struct __test_metadata *_metadata, {if (tracer) {int status; -/* -* Extract the exit code from the other process and -* adopt it for ourselves in case its asserts failed. -*/ ASSERT_EQ (0 ,kill (tracer,SIGUSR1 ));ASSERT_EQ (tracer,waitpid (tracer, &status,0 )); -if (WEXITSTATUS (status)) - _metadata->exit_code =KSFT_FAIL ; } }
Signature · 1 line
2.39.5
Quoted 9 lines · Terry Tritton
TRACE_syscall.ptrace.negative_ENOSYS and TRACE_syscall.seccomp.negative_ENOSYS on arm32 are being reported as failures instead of skipping.
The
teardown_trace_fixturefunction sets the test toKSFT_FAILin case of a non 0 return value from the tracer process.
Due to_metadatanow being shared between the forked processes the tracer is returning theKSFT_SKIPvalue set by the tracee which is non 0.[...]
Ooh yes, nice catch!
Applied to for-next/seccomp, thanks!
[1/1] selftests/seccomp: fix negative_ENOSYS tracer tests on arm32
https://git.kernel.org/kees/c/73989c998814
Take care,
Signature · 1 line
Kees Cook