[PATCH] selftests/mm: uffd-unit-test check if huge page size is 0

2024-02-05 Thread Terry Tritton
If HUGETLBFS is not enabled then the default_huge_page_size function will return 0 and cause a divide by 0 error. Add a check to see if the huge page size is 0 and skip the hugetlb tests if it is. Signed-off-by: Terry Tritton --- tools/testing/selftests/mm/uffd-unit-tests.c | 6 ++ 1 file

[PATCH 3/3] selftests/seccomp: user_notification_addfd check nextfd is available

2024-01-24 Thread Terry Tritton
function get_next_fd which will check and return the next available file descriptor. Signed-off-by: Terry Tritton --- tools/testing/selftests/seccomp/seccomp_bpf.c | 24 +++ 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/seccomp

[PATCH 2/3] selftests/seccomp: Change the syscall used in KILL_THREAD test

2024-01-24 Thread Terry Tritton
: Terry Tritton --- tools/testing/selftests/seccomp/seccomp_bpf.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 5e705674b706..da11b95b8872 100644 --- a/tools/testing

[PATCH 1/3] selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID)

2024-01-24 Thread Terry Tritton
unshare(CLONE_NEWPID) can return EINVAL if the kernel does not have the CONFIG_PID_NS option enabled. Add a check on these calls to skip the test if we receive EINVAL. Signed-off-by: Terry Tritton --- tools/testing/selftests/seccomp/seccomp_bpf.c | 9 - 1 file changed, 8 insertions

[PATCH 0/3] selftests/seccomp seccomp_bpf test fixes

2024-01-24 Thread Terry Tritton
iptor 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_T