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,DKIM_SIGNED, DKIM_VALID,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 E9BCB1F45E for ; Thu, 13 Feb 2020 18:42:07 +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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=vnus4vuarwq9IFZ+tCFvboZld0ZYH7Pt3xvnuV7Jke6waQvR8sp2c dUHrwGUSGJ16syJO5bCsb7sCq9TU3TIeKQlm5PZvpjndjox6/Uin+Kik7vIN6z9X oisB469gUeE6JuzzqRDWaiksdoP6JYAJDOMt6Mi98DHVkgkktZkXDo= 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=Z2JqRYte5tNCuefpVaDZ4iQjXZc=; b=TuelVp/FM/IsZQXTrCbNSp29ROPM J046aKJRdJUEOhX/8FLwY0PKgiphR5mkBhG0LqODGS2lihDP2FdbYfeOoZMfSpng eJdQVqEKZC2e2gwHkBtYJKiSkXwoPNRbNzY9RxENy0n1nk4VgO3fwcj7p1yOyHDK G1IlrNUgZ/kRQU0= Received: (qmail 75935 invoked by alias); 13 Feb 2020 18:42:05 -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 75927 invoked by uid 89); 13 Feb 2020 18:42:05 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx0a-001b2d01.pphosted.com From: "Lucas A. M. Magalhaes" To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH V2] Fix tst-pkey expectations on pkey_get Date: Thu, 13 Feb 2020 15:41:57 -0300 Message-Id: <20200213184157.16778-1-lamm@linux.ibm.com> In-Reply-To: <20200207134604.29046-1-lamm@linux.ibm.com> References: <20200207134604.29046-1-lamm@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit >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. 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. The pkey behavior during signal handling is different between x86 and POWER. This change make the test compatible with both architectures. --- Hi, This test still needs the patch on the link to work on POWER. https://sourceware.org/ml/libc-alpha/2018-05/msg00760.html in V2: - Fix signal handling expectations to accept x86 and POWER behavior. sysdeps/unix/sysv/linux/tst-pkey.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; /* The keys used for testing. These have been allocated with access rights set based on their array index. */ -enum { key_count = 4 }; +enum { key_count = 3 }; static int keys[key_count]; static volatile int *pages[key_count]; @@ -118,7 +118,8 @@ sigusr1_handler (int signum) { TEST_COMPARE (signum, SIGUSR1); for (int i = 0; i < key_count; ++i) - TEST_COMPARE (pkey_get (keys[i]), PKEY_DISABLE_ACCESS); + TEST_VERIFY (pkey_get (keys[i]) == PKEY_DISABLE_ACCESS + || pkey_get (keys[i]) == i); sigusr1_handler_ran = 1; } -- 2.20.1