From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id A846A386DC5A for ; Sun, 26 Jun 2022 21:40:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A846A386DC5A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=38763 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1o5ZzJ-00DnBz-BL; Sun, 26 Jun 2022 21:40:13 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1o5ZgA-00093T-9C; Sun, 26 Jun 2022 23:20:26 +0200 From: Florian Weimer To: Mark Wielaard Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 3/4] tst-pidfd.c: Test is UNSUPPORTED without PTRACE_MODE_ATTACH_REALCREDS References: <20220626205915.33201-1-mark@klomp.org> <20220626205915.33201-4-mark@klomp.org> Date: Sun, 26 Jun 2022 23:20:26 +0200 In-Reply-To: <20220626205915.33201-4-mark@klomp.org> (Mark Wielaard's message of "Sun, 26 Jun 2022 22:59:14 +0200") Message-ID: <87h747nmud.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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: Sun, 26 Jun 2022 21:40:16 -0000 * Mark Wielaard: > pidfd_getfd will fail with errno EPERM if the calling process did not > have PTRACE_MODE_ATTACH_REALCREDS permissions. Use FAIL_UNSUPPORTED > in that case. > --- > sysdeps/unix/sysv/linux/tst-pidfd.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c > index d93b6faa6f..28349b2f91 100644 > --- a/sysdeps/unix/sysv/linux/tst-pidfd.c > +++ b/sysdeps/unix/sysv/linux/tst-pidfd.c > @@ -95,8 +95,10 @@ do_test (void) > kernel has pidfd support that we can test. */ > int r = pidfd_getfd (0, 0, 1); > TEST_VERIFY_EXIT (r == -1); > - if (errno == ENOSYS) > - FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd, skipping test"); > + if (errno == ENOSYS || errno == EPERM) > + FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd," > + " or we don't have PTRACE_MODE_ATTACH_REALCREDS" > + " permissions, skipping test"); > } This also hints towards a broken seccomp filter.