Skip to content

Commit

Permalink
selftests/seccomp: Stop USER_NOTIF test if kcmp() fails
Browse files Browse the repository at this point in the history
If kcmp() fails during the USER_NOTIF test, the test is likely to hang,
so switch from EXPECT to ASSERT.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://lore.kernel.org/r/20211103163039.2104830-2-keescook@chromium.org
  • Loading branch information
Kees Cook committed Nov 3, 2021
1 parent d9bbdbf commit 48d5fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/seccomp/seccomp_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48d5fd0

Please sign in to comment.