Message ID | 1516647137-11174-15-git-send-email-linuxram@us.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zQMLf4dDkz9s4s for <patchwork-incoming@ozlabs.org>; Tue, 23 Jan 2018 06:43:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DkXxdHSP"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zQMLf2nVwzDqK8 for <patchwork-incoming@ozlabs.org>; Tue, 23 Jan 2018 06:43:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DkXxdHSP"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::241; helo=mail-qt0-x241.google.com; envelope-from=ram.n.pai@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DkXxdHSP"; dkim-atps=neutral Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zQLDV1WjszF0XQ for <linuxppc-dev@lists.ozlabs.org>; Tue, 23 Jan 2018 05:53:30 +1100 (AEDT) Received: by mail-qt0-x241.google.com with SMTP id l20so22130253qtj.11 for <linuxppc-dev@lists.ozlabs.org>; Mon, 22 Jan 2018 10:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=44rQITY9DaDodeIBIPfwot0aefJAd5ZPTj/2PaqgyR8=; b=DkXxdHSPF26fEoBXAWOO3J3qfK4mi99g1OgwVlf0Eg2Hw8cOoiI985aBzn2LTOWSX6 emgtsTYPdsLHjw8I1799Bagn4kOVV65ExsR/6uf7r+fJYPJjF8Vrb8EpHwmnseGhr68b 8J9NGVkVxuc1kz+5iolePUo4Khd4w0VX4zLnamWcCWo8GDI5iiaG8GJ9zxYboFEk1n0R +NmtWOHt2JmuWZmwuvqfTohV5jqMonTMI9LAKHNakqAze+qnoSu78m3gFtC9ov/3DzHw 5MFL8jC79QzCzISW2tXXmp7jFExm4Kixg98jvPo76Fp7Vz1i5rLTTbUOHXMkf2CXUkaM 11iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=44rQITY9DaDodeIBIPfwot0aefJAd5ZPTj/2PaqgyR8=; b=kteiWSviN5qT5x8EvTQ1KRsUoT7Nr9JkejSRO2VgMdS6rN+kQ3LIM9IFK3JTTIxorV De3ykb2XsxLWlanp+UQtpzO7yIbAgqOgfCIdsjBGlCD5KBq7lXIn/Np5GRyFqVywlEaM e0WXfPFCL4RIMRQZxRCupnoJqG20ez53xCcGO8eh0R9xpC5Gr9hU26S02ZVliCp4VXl8 WdtJ5kmfOUjz0An8CBw8jbCdFyI1AcDvbW3HpzrbBprv8tlVw1x+nl8ZfoFemqcwS/AU fvbCQMMJ1E0dcaoYW7v1qUeZ+Ez0Bf6le/msF9BcT7P9BToeoCcqFenVerZEFN0i5hSk Et+w== X-Gm-Message-State: AKwxytcaMAkaYZtVqrzXUtXREb9oNM+u2he04vuP+5jKbDkcf9MbN56u lKAP+clhqJEFL1EZ8HSSPYs= X-Google-Smtp-Source: AH8x224J9XQ6QLCpc2k5pJkPbYJBkuZUSni3R9mDCwRKYAdd9IlenUNtGpX7Ef1dzX4HEz7p31CPEA== X-Received: by 10.237.49.105 with SMTP id 96mr11809509qtg.52.1516647208360; Mon, 22 Jan 2018 10:53:28 -0800 (PST) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id o20sm10790061qkl.14.2018.01.22.10.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:53:27 -0800 (PST) From: Ram Pai <linuxram@us.ibm.com> To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Subject: [PATCH v10 14/24] selftests/vm: clear the bits in shadow reg when a pkey is freed. Date: Mon, 22 Jan 2018 10:52:07 -0800 Message-Id: <1516647137-11174-15-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> References: <1516647137-11174-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev/> List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> Cc: linux-arch@vger.kernel.org, ebiederm@xmission.com, arnd@arndb.de, linux-doc@vger.kernel.org, x86@kernel.org, dave.hansen@intel.com, linux-kernel@vger.kernel.org, linuxram@us.ibm.com, mhocko@kernel.org, linux-mm@kvack.org, mingo@redhat.com, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> |
Series |
selftests, powerpc, x86 : Memory Protection Keys
|
expand
|
diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c index 55a25e1..d1cbdfe 100644 --- a/tools/testing/selftests/vm/protection_keys.c +++ b/tools/testing/selftests/vm/protection_keys.c @@ -586,7 +586,8 @@ int sys_pkey_free(unsigned long pkey) int ret = syscall(SYS_pkey_free, pkey); if (!ret) - shadow_pkey_reg &= reset_bits(pkey, PKEY_DISABLE_ACCESS); + shadow_pkey_reg &= reset_bits(pkey, + PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE); dprintf1("%s(pkey=%ld) syscall ret: %d\n", __func__, pkey, ret); return ret; }
When a key is freed, the key is no more effective. Clear the bits corresponding to the pkey in the shadow register. Otherwise it will carry some spurious bits which can trigger false-positive asserts. Signed-off-by: Ram Pai <linuxram@us.ibm.com> --- tools/testing/selftests/vm/protection_keys.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)