From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 29D216810B5 for ; Tue, 11 Jul 2017 14:12:40 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id v26so11726pfa.0 for ; Tue, 11 Jul 2017 11:12:40 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com. [192.55.52.43]) by mx.google.com with ESMTPS id 92si437435plw.203.2017.07.11.11.12.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 11:12:39 -0700 (PDT) Subject: Re: [RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE References: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> <1499289735-14220-14-git-send-email-linuxram@us.ibm.com> From: Dave Hansen Message-ID: <1692f8f5-456c-dc4a-4502-a2ea63ede094@intel.com> Date: Tue, 11 Jul 2017 11:12:37 -0700 MIME-Version: 1.0 In-Reply-To: <1499289735-14220-14-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ram Pai , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com On 07/05/2017 02:21 PM, Ram Pai wrote: > x86 does not support disabling execute permissions on a pkey. > > Signed-off-by: Ram Pai > --- > arch/x86/kernel/fpu/xstate.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c > index c24ac1e..d582631 100644 > --- a/arch/x86/kernel/fpu/xstate.c > +++ b/arch/x86/kernel/fpu/xstate.c > @@ -900,6 +900,9 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, > if (!boot_cpu_has(X86_FEATURE_OSPKE)) > return -EINVAL; > > + if (init_val & PKEY_DISABLE_EXECUTE) > + return -EINVAL; I'd really rather that we define a supported mask instead of having each architecture go through and list which ones it supports. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org