linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] selftests/seccomp seccomp_bpf test fixes
@ 2024-01-24 14:13 Terry Tritton
  2024-01-24 14:13 ` [PATCH 1/3] selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID) Terry Tritton
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Terry Tritton @ 2024-01-24 14:13 UTC (permalink / raw)
  To: keescook, luto, wad, shuah
  Cc: linux-kselftest, linux-kernel, peter.griffin, kernel-team,
	bettyzhou, Terry Tritton

Hi,
Here are a few fixes for seccomp_bpf tests found when testing on 
Android:

user_notification_sibling_pid_ns:
  unshare(CLONE_NEWPID) can return EINVAL so have added a check for this.

KILL_THREAD:
  This one is a bit more Android specific. 
  In Bionic pthread_create is calling prctl, this is causing the test to 
  fail as prctl is in the filter for this test and is killed when it is 
  called. I've just changed prctl to getpid in this case.

user_notification_addfd:
  This test can fail if there are existing file descriptors when the test 
  starts. It expects the next file descriptor to always increase 
  sequentially which is not always the case.
  Added a get_next_fd function to return the next expected file descriptor.

Regards,

Terry

Terry Tritton (3):
  selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID)
  selftests/seccomp: Change the syscall used in KILL_THREAD test
  selftests/seccomp: user_notification_addfd check nextfd is available

 tools/testing/selftests/seccomp/seccomp_bpf.c | 41 ++++++++++++++-----
 1 file changed, 31 insertions(+), 10 deletions(-)

-- 
2.43.0.429.g432eaa2c6b-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-24 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24 14:13 [PATCH 0/3] selftests/seccomp seccomp_bpf test fixes Terry Tritton
2024-01-24 14:13 ` [PATCH 1/3] selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID) Terry Tritton
2024-01-24 14:13 ` [PATCH 2/3] selftests/seccomp: Change the syscall used in KILL_THREAD test Terry Tritton
2024-01-24 14:13 ` [PATCH 3/3] selftests/seccomp: user_notification_addfd check nextfd is available Terry Tritton
2024-01-24 16:21 ` [PATCH 0/3] selftests/seccomp seccomp_bpf test fixes Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).