Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1242872pxa; Thu, 20 Aug 2020 06:34:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyrezAr53inK58QHUc08ia0AIiL9u6zwiKXNAz2HpXO3JpgiyG2zO6FoOiG4OZO/41bedT X-Received: by 2002:a17:907:94ca:: with SMTP id dn10mr3289503ejc.110.1597930477003; Thu, 20 Aug 2020 06:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930476; cv=none; d=google.com; s=arc-20160816; b=v5/ss5+D1SovrnVCVRjjUTs9RyChomNfDSgKgNK2eVIKIRQXkEdqussuYDFY33KJCD EoZNhZli2ptIZEya4jPFyHsstWrIAyb3mMLN3DCBJM0qaPykk56BTnfnwtq5o83643qG Ui/4RrfvaVzqBmm+EPyi/G64UydCuzH+06s6VVutD0QDOkIloCZxIB/xCPjzsK0eVB7H GIWn77sG5lqkVUwWcd/SQ3GEA5vH+7i/YwL97DgB8gUjmoKDHdSr9JXt8pJMqzt9KlZK jsX7kiuLwzWDfnQ93eSyW1khKTu9YpFKxBRuZ+nemSiizgQYNfjygkECn84b97DXvrJs IKOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zYjek3rZKOh2GLIpEouunlsIfcefBxAUij0qbfgmTA0=; b=yI2mi7iDL4QMG5kv5+QhAmQIS3His2FUT3f+2mWMWROio8bqnZKVWIFOu1mwuA4MUF l15QnuEfU0tx7Sz6cqwa91h61+NG8vpr5bFjRythq3XjujmZrKu6qDrSnE9rsY+RacSj noXN1V/uPykKmgVohgQ2JrMIkBrd97diWVt2QImW0zsmkJCcbwjZJJ0VbkS+7heOzxqd ATekXgQETFGKiWFgF7eW49Br8sb0g6D+zKzDMjIpUlqoB7dJg6UEKf0vgTwHdVQBAn5H VsIub5VM85z84CuzWNsxs/Ib3lqNW1+fqdeO1RFq39Gq/y7363LmxEnjF+iEMD4OGy5z LJUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N0YkF4dU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo4si1127609ejb.455.2020.08.20.06.34.12; Thu, 20 Aug 2020 06:34:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N0YkF4dU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728846AbgHTNdo (ORCPT + 99 others); Thu, 20 Aug 2020 09:33:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:41904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728190AbgHTJau (ORCPT ); Thu, 20 Aug 2020 05:30:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75523207DE; Thu, 20 Aug 2020 09:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915849; bh=kJJouGqpk7y9KGYIB/qSQlzNKFugPURJbr0dDf5g/yA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N0YkF4dUR4AcpAj0qzjv3EwIrbuaCM/4kTsWMyH651WyJDJINAlH/Z0j8LPWP9VTk A4scw0gWOCBjMXzWLYhAKnVBIlYeu+gVN5C6NxTDBGzecZjHXzRawVxf2idme6+5Eu 9qy10tSyrLil7WyaWxMaFXBlySmFkokpRRdg9gtU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Aneesh Kumar K.V" , Michael Ellerman , Sasha Levin Subject: [PATCH 5.8 154/232] selftests/powerpc: ptrace-pkey: Dont update expected UAMOR value Date: Thu, 20 Aug 2020 11:20:05 +0200 Message-Id: <20200820091620.269436164@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aneesh Kumar K.V [ Upstream commit 3563b9bea0ca7f53e4218b5e268550341a49f333 ] With commit 4a4a5e5d2aad ("powerpc/pkeys: key allocation/deallocation must not change pkey registers") we are not updating UAMOR on key allocation. So don't update the expected uamor value in the test. Fixes: 4a4a5e5d2aad ("powerpc/pkeys: key allocation/deallocation must not change pkey registers") Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200709032946.881753-23-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin --- tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index bc33d748d95b4..3694613f418f6 100644 --- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c @@ -101,15 +101,20 @@ static int child(struct shared_info *info) */ info->invalid_amr = info->amr2 | (~0x0UL & ~info->expected_uamor); + /* + * if PKEY_DISABLE_EXECUTE succeeded we should update the expected_iamr + */ if (disable_execute) info->expected_iamr |= 1ul << pkeyshift(pkey1); else info->expected_iamr &= ~(1ul << pkeyshift(pkey1)); - info->expected_iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3)); + /* + * We allocated pkey2 and pkey 3 above. Clear the IAMR bits. + */ + info->expected_iamr &= ~(1ul << pkeyshift(pkey2)); + info->expected_iamr &= ~(1ul << pkeyshift(pkey3)); - info->expected_uamor |= 3ul << pkeyshift(pkey1) | - 3ul << pkeyshift(pkey2); /* * Create an IAMR value different from expected value. * Kernel will reject an IAMR and UAMOR change. -- 2.25.1