Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681850 > unrolled thread

[RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE

Started byRam Pai <linuxram@us.ibm.com>
First post2017-07-05 23:40 +0200
Last post2017-07-11 20:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE Ram Pai <linuxram@us.ibm.com> - 2017-07-05 23:40 +0200
    Re: [RFC v5 13/38] x86: disallow pkey creation with  PKEY_DISABLE_EXECUTE Dave Hansen <dave.hansen@intel.com> - 2017-07-11 20:20 +0200

#1681850 — [RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE

FromRam Pai <linuxram@us.ibm.com>
Date2017-07-05 23:40 +0200
Subject[RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE
Message-ID<u00bE-3nZ-9@gated-at.bofh.it>
x86 does not support disabling execute permissions on a pkey.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 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;
+
 	/* Set the bits we need in PKRU:  */
 	if (init_val & PKEY_DISABLE_ACCESS)
 		new_pkru_bits |= PKRU_AD_BIT;
-- 
1.7.1

[toc] | [next] | [standalone]


#1685275 — Re: [RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE

FromDave Hansen <dave.hansen@intel.com>
Date2017-07-11 20:20 +0200
SubjectRe: [RFC v5 13/38] x86: disallow pkey creation with PKEY_DISABLE_EXECUTE
Message-ID<u27Vp-5Hk-13@gated-at.bofh.it>
In reply to#1681850
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 <linuxram@us.ibm.com>
> ---
>  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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web