Skip to content

Commit 2bd61ab

Browse files
keesShuah Khan
authored andcommitted
selftests/seccomp: Remove SIGSTOP si_pid check
Commit f149b31 ("signal: Never allocate siginfo for SIGKILL or SIGSTOP") means that the seccomp selftest cannot check si_pid under SIGSTOP anymore. Since it's believed[1] there are no other userspace things depending on the old behavior, this removes the behavioral check in the selftest, since it's more a "extra" sanity check (which turns out, maybe, not to have been useful to test). [1] https://lkml.kernel.org/r/CAGXu5jJaZAOzP1qFz66tYrtbuywqb+UN2SOA1VLHpCCOiYvYeg@mail.gmail.com Reported-by: Tycho Andersen <tycho@tycho.ws> Suggested-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Shuah Khan <shuah@kernel.org>
1 parent 6510223 commit 2bd61ab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,9 +2731,14 @@ TEST(syscall_restart)
27312731
ASSERT_EQ(child_pid, waitpid(child_pid, &status, 0));
27322732
ASSERT_EQ(true, WIFSTOPPED(status));
27332733
ASSERT_EQ(SIGSTOP, WSTOPSIG(status));
2734-
/* Verify signal delivery came from parent now. */
27352734
ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info));
2736-
EXPECT_EQ(getpid(), info.si_pid);
2735+
/*
2736+
* There is no siginfo on SIGSTOP any more, so we can't verify
2737+
* signal delivery came from parent now (getpid() == info.si_pid).
2738+
* https://lkml.kernel.org/r/CAGXu5jJaZAOzP1qFz66tYrtbuywqb+UN2SOA1VLHpCCOiYvYeg@mail.gmail.com
2739+
* At least verify the SIGSTOP via PTRACE_GETSIGINFO.
2740+
*/
2741+
EXPECT_EQ(SIGSTOP, info.si_signo);
27372742

27382743
/* Restart nanosleep with SIGCONT, which triggers restart_syscall. */
27392744
ASSERT_EQ(0, kill(child_pid, SIGCONT));

0 commit comments

Comments
 (0)