From 2750572ae2d2f86f3eefca8eb0af14dbbf3d02ac Mon Sep 17 00:00:00 2001 From: Manuel Diewald Date: Mon, 24 Jun 2024 17:46:52 +0200 Subject: [PATCH] Revert "UBUNTU: SAUCE: selftests/seccomp: fix check of fds being assigned" BugLink: https://bugs.launchpad.net/bugs/2070337 This reverts commit 1cc7fe1936bf5992f7a0934bf7af2509f4d7d442. The issue seems to be fixed in a more complete fashion by upstream commit 8e3c9f9f3a0742cd12b682a1766674253b33fcf0. Revert our SAUCE patch and apply the upstream commit that comes with upstream stable update v6.8.9. Signed-off-by: Manuel Diewald Signed-off-by: Stefan Bader --- tools/testing/selftests/seccomp/seccomp_bpf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 04f0611234d7..38f651469968 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -4053,17 +4053,18 @@ TEST(user_notification_addfd) /* There may be arbitrary already-open fds at test start. */ memfd = memfd_create("test", 0); ASSERT_GE(memfd, 0); + nextfd = memfd + 1; ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); ASSERT_EQ(0, ret) { TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); } + /* fd: 4 */ /* Check that the basic notification machinery works */ listener = user_notif_syscall(__NR_getppid, SECCOMP_FILTER_FLAG_NEW_LISTENER); - ASSERT_GE(listener, 0); - nextfd = listener + 1; + ASSERT_EQ(listener, nextfd++); pid = fork(); ASSERT_GE(pid, 0);