From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 57CF3385803D for ; Mon, 27 Jun 2022 14:23:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57CF3385803D Received: by mail-ot1-x32c.google.com with SMTP id b23-20020a9d7557000000b00616c7999865so3024231otl.12 for ; Mon, 27 Jun 2022 07:23:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tvKlvNqY2gidze6gVwUlCAF8nO6t/u1cp/zcPS9NR7A=; b=OeavaTKxXpHfld/+kaijoAyfGaZ0DoEMo+OuzS9UeuWtKFKjwc5OGfj39SQMNNeLnr hsdiXrhXOSgbUk82nSInBb+4yPwf0Y3pAeP2Vt85Bb0wAxCcG5TRVLZhhRqGc/XOH0XK hsBNioFSnlT5tG7Z8VcORl0CuW4Y0Bv5dUu4e7V7fYPblhduL4Npu8CWrIeYooJdKCAE mYVWlzwfPRPTIfDu2yzRKIPr1Lp9zyV2LU6CH71VR611mq5e65FTM2ZkwZWs+MZWOaR/ iT0FFV5qx2My4qFYvcscX2pyHV3Z0DNDKMEgeoiqnwXphJL+m1XdhlBYOC1R4NfWQKWn DILQ== X-Gm-Message-State: AJIora81sKesdoijtVx20+hUR8g3L0PSYUc/zpfkyibATzYirm7YdTNG RhtaoRu0SerQZMsrVxk2XU6+2dNrjfdT6FLC X-Google-Smtp-Source: AGRyM1tapKnlQ/DS4LydsHF5vWiXREyrmNqJtOTYpKOUlAyONbglq4eTi/csQpxKTxpWkJABK4J0Dg== X-Received: by 2002:a05:6830:d0d:b0:616:99da:1fb0 with SMTP id bu13-20020a0568300d0d00b0061699da1fb0mr5897545otb.109.1656339830498; Mon, 27 Jun 2022 07:23:50 -0700 (PDT) Received: from smtpclient.apple ([2804:431:c7ca:6d95:e1d4:5b7b:d7d4:ce7e]) by smtp.gmail.com with ESMTPSA id m14-20020a05683023ae00b00616958279dcsm6185959ots.79.2022.06.27.07.23.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jun 2022 07:23:50 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH 3/4] tst-pidfd.c: Test is UNSUPPORTED without PTRACE_MODE_ATTACH_REALCREDS From: Adhemerval Zanella In-Reply-To: <20220626205915.33201-4-mark@klomp.org> Date: Mon, 27 Jun 2022 11:23:47 -0300 Cc: libc-alpha@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220626205915.33201-1-mark@klomp.org> <20220626205915.33201-4-mark@klomp.org> To: Mark Wielaard X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: Mon, 27 Jun 2022 14:23:52 -0000 > On 26 Jun 2022, at 17:59, Mark Wielaard wrote: >=20 > 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. =46rom the discussion this is a possible error for the syscall. However I think it would be good print different errors for ENOSYS and EPERM. > --- > sysdeps/unix/sysv/linux/tst-pidfd.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > 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 =3D pidfd_getfd (0, 0, 1); > TEST_VERIFY_EXIT (r =3D=3D -1); > - if (errno =3D=3D ENOSYS) > - FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd, = skipping test"); > + if (errno =3D=3D ENOSYS || errno =3D=3D EPERM) > + FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd," > + " or we don't have PTRACE_MODE_ATTACH_REALCREDS" > + " permissions, skipping test"); Keep the ENOSYS error message and add EPERM. > } >=20 > ppid =3D getpid (); > --=20 > 2.30.2 >=20