From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5A5523858D32 for ; Mon, 15 Aug 2022 05:38:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A5523858D32 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-E4yri3yQMhylydLPGCiXiw-1; Mon, 15 Aug 2022 01:38:48 -0400 X-MC-Unique: E4yri3yQMhylydLPGCiXiw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7808885A581; Mon, 15 Aug 2022 05:38:48 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54C0540466B1; Mon, 15 Aug 2022 05:38:47 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Mark Wielaard , freswa@archlinux.org, sam@gentoo.org Subject: [PATCH] Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485) Date: Mon, 15 Aug 2022 07:38:45 +0200 Message-ID: <87tu6ejcbe.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2022 05:38:54 -0000 --- sysdeps/unix/sysv/linux/tst-pidfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c index 037af22290..5711d1c312 100644 --- a/sysdeps/unix/sysv/linux/tst-pidfd.c +++ b/sysdeps/unix/sysv/linux/tst-pidfd.c @@ -147,8 +147,11 @@ do_test (void) may be denied if the process doesn't have CAP_SYS_PTRACE or if a LSM security_ptrace_access_check denies access. */ if (fd == -1 && errno == EPERM) - FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, " - "skipping test"); + { + TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0); + FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, " + "skipping test"); + } TEST_VERIFY (fd > 0); char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);