From: Kees Cook Date: Wed, 3 Nov 2021 16:30:38 +0000 (-0700) Subject: selftests/seccomp: Stop USER_NOTIF test if kcmp() fails X-Git-Tag: v6.1-rc5~2314^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48d5fd06453de57f9d9385c7ebcdf3b50658a962;p=platform%2Fkernel%2Flinux-starfive.git selftests/seccomp: Stop USER_NOTIF test if kcmp() fails If kcmp() fails during the USER_NOTIF test, the test is likely to hang, so switch from EXPECT to ASSERT. Cc: Andy Lutomirski Cc: Will Drewry Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook Acked-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/20211103163039.2104830-2-keescook@chromium.org --- diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 1d64891e6492..d999643d577c 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -4087,7 +4087,7 @@ TEST(user_notification_addfd) * lowest available fd to be assigned here. */ EXPECT_EQ(fd, nextfd++); - EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); + ASSERT_EQ(filecmp(getpid(), pid, memfd, fd), 0); /* * This sets the ID of the ADD FD to the last request plus 1. The