From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B9DA41F45E for ; Fri, 14 Feb 2020 17:02:52 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=VHE3gX2a4OCWv7faA2EHnWA74CfPdtKXJqtejAkXGRA p26bndjI5B4MxJVXCrI7Nh0pAhy6xKyaaBT4UEz5jgyXQhRJ8FYosH0m/XCvmPGe lHG5jGKljaKi1+9/v9XWah0hbCza2enZpybAQxvKMvbn8Pbn2Q5EjBslmqaadpNk = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=zDlRr+k6l6l8EEhSidl+w8SfpsI=; b=X9MeJcUyXO+pfg0uk hPvsCjXgx4f1p33opEAwrWD7G1Syv8v8kPuuLFKkACX7MQPwjNY3B5tNlD3SrmGJ kGOF9Fy0QvlRz9qPL6W/FfHBkJhipWM77YEZVdUQDkCEONNNdBHniIiPtsw5ONYg IaQBbKFbG9z3LwWgWP9vHddvdI= Received: (qmail 22893 invoked by alias); 14 Feb 2020 17:02:50 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 22883 invoked by uid 89); 14 Feb 2020 17:02:49 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581699767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DvXsgiNHsJ6LNaSka5erL1NzwtB0oagF1453fFYkvVs=; b=eBnql4LHHExVSLLT/a6GH1Yq6vDCK6VKFa9ilhVcx4s7/MEDKZYlVLFNHdbrFVLE1HwJOn txqKPMCJuEPfKFBWZLGRkak8v1nWrlkRmotIwSziyQ+b4KbFF2lVPzUYgquWpxGOwJCzDd MVg4y+O+7UTv4S3Uw/icrSPz4ovO+Sg= From: Florian Weimer To: "Lucas A. M. Magalhaes" Cc: libc-alpha@sourceware.org Subject: Re: [PATCH V2] Fix tst-pkey expectations on pkey_get References: <20200207134604.29046-1-lamm@linux.ibm.com> <20200213184157.16778-1-lamm@linux.ibm.com> Date: Fri, 14 Feb 2020 18:02:39 +0100 In-Reply-To: <20200213184157.16778-1-lamm@linux.ibm.com> (Lucas A. M. Magalhaes's message of "Thu, 13 Feb 2020 15:41:57 -0300") Message-ID: <87r1yx14r4.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable * Lucas A. M. Magalhaes: > From the GNU LibC Manual the pkey_set can receive a combination of > PKEY_DISABLE_WRITE and PKEY_DISABLE_ACCESS. However PKEY_DISABLE_ACCESS > is more restrictive than PKEY_DISABLE_WRITE and includes its behavior. =E2=80=9Cglibc manual=E2=80=9D or =E2=80=9CGNU C Library manual=E2=80=9D. > The test expects that after setting > (PKEY_DISABLE_WRITE|PKEY_DISABLE_ACCESS) pkey_get should return the > same. This may not be true as PKEY_DISABLE_ACCESS will succeed in > describe the state of the key in this case. Please reference [BZ #23202] in the commit message. > The pkey behavior during signal handling is different between x86 and > POWER. This change make the test compatible with both architectures. > diff --git a/sysdeps/unix/sysv/linux/tst-pkey.c b/sysdeps/unix/sysv/linux= /tst-pkey.c > index 4ea1bc4f9a..ffa65cd5de 100644 > --- a/sysdeps/unix/sysv/linux/tst-pkey.c > +++ b/sysdeps/unix/sysv/linux/tst-pkey.c > @@ -37,7 +37,7 @@ static pthread_barrier_t barrier; > =20 > /* The keys used for testing. These have been allocated with access > rights set based on their array index. */ > -enum { key_count =3D 4 }; > +enum { key_count =3D 3 }; > static int keys[key_count]; > static volatile int *pages[key_count]; Okay. > @@ -118,7 +118,8 @@ sigusr1_handler (int signum) > { > TEST_COMPARE (signum, SIGUSR1); > for (int i =3D 0; i < key_count; ++i) > - TEST_COMPARE (pkey_get (keys[i]), PKEY_DISABLE_ACCESS); > + TEST_VERIFY (pkey_get (keys[i]) =3D=3D PKEY_DISABLE_ACCESS > + || pkey_get (keys[i]) =3D=3D i); > sigusr1_handler_ran =3D 1; > } Please add a comment explicitly describing the POWER and x86-64 behaviors. Thanks. Florian