From patchwork Fri Feb 7 13:46:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lucas A. M. Magalhaes" X-Patchwork-Id: 1234930 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109254-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=DwikoCp0; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 48Dc5k2Vmrz9sRG for ; Sat, 8 Feb 2020 00:46:18 +1100 (AEDT) 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 :mime-version:content-transfer-encoding; q=dns; s=default; b=go3 9GbI7atDNl8Ub6TxLKJWN/q3vGqeguU7mcYMjXnUjaug+BvLNH6lZ77Ew4E7hy2y +2RoqakGKsXB7IxPr0CTDS+h4aJeQfO11gaGSHiCnKeTyE8pyYnI2zBFhsaoAbfn ai3z1pyT5nqcqA5EsMxFfssAPPqGkYUTLvQuMVvU= 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 :mime-version:content-transfer-encoding; s=default; bh=xIpTZ7ibN qF6Qm0CgnKVAazaGaA=; b=DwikoCp0dDKTDZkClVMUw8MNeNiUu6XRCCZjTKBhw NcCJK3Pqqblu8oXg7dCjfsBaLN4iHIy4eUiHS/Z25h/XkNnq9j1G4/0wAjsl9LQR 3yKeOp7jR75sTsPGsLwv12elE+GaChq5jAydLyaEuPFiobDsVpTC1WuKcd9kXwh5 S0= Received: (qmail 97819 invoked by alias); 7 Feb 2020 13:46:12 -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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 97806 invoked by uid 89); 7 Feb 2020 13:46:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com From: "Lucas A. M. Magalhaes" To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH] Fix tst-pkey expectations on pkey_get Date: Fri, 7 Feb 2020 10:46:04 -0300 Message-Id: <20200207134604.29046-1-lamm@linux.ibm.com> MIME-Version: 1.0 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. --- Hi, Florian, Your patch including pkey_set and pkey_get looks good to me. Can you merge it? This one https://sourceware.org/ml/libc-alpha/2018-05/msg00760.html. With this there will be one failure on this test on powerpc machines. The test expects that during a signal handling the pkey_get returns PKEY_DISABLE_ACCESS for all keys. In my tests it returns the same permissions as before the signal. I couldn't find where this is done for x86. Is this kernel implementation? sysdeps/unix/sysv/linux/tst-pkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/tst-pkey.c b/sysdeps/unix/sysv/linux/tst-pkey.c index 4ea1bc4f9a..11084520b3 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];