lkml.org 
[lkml]   [2016]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 31/31] x86, pkeys: execute-only support
On Wed, 6 Jan 2016, Dave Hansen wrote:
>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>

> diff -puN arch/x86/mm/fault.c~pkeys-79-xonly arch/x86/mm/fault.c
> --- a/arch/x86/mm/fault.c~pkeys-79-xonly 2016-01-06 15:50:16.799660453 -0800
> +++ b/arch/x86/mm/fault.c 2016-01-06 15:50:16.810660949 -0800
> @@ -14,6 +14,8 @@
> #include <linux/prefetch.h> /* prefetchw */
> #include <linux/context_tracking.h> /* exception_enter(), ... */
> #include <linux/uaccess.h> /* faulthandler_disabled() */
> +#include <linux/pkeys.h> /* PKEY_* */
> +#include <uapi/asm-generic/mman-common.h>
>
> #include <asm/cpufeature.h> /* boot_cpu_has, ... */
> #include <asm/traps.h> /* dotraplinkage, ... */
> @@ -23,6 +25,7 @@
> #include <asm/vsyscall.h> /* emulate_vsyscall */
> #include <asm/vm86.h> /* struct vm86 */
> #include <asm/mmu_context.h> /* vma_pkey() */
> +#include <asm/fpu/internal.h> /* fpregs_active() */

These include changes are presumably leftovers from an earlier version. At
least I can't see a reason why we would need them for the change below.

> #define CREATE_TRACE_POINTS
> #include <asm/trace/exceptions.h>
> @@ -1108,6 +1111,16 @@ access_error(unsigned long error_code, s
> */
> if (error_code & PF_PK)
> return 1;
> +
> + if (!(error_code & PF_INSTR)) {
> + /*
> + * Assume all accesses require either read or execute
> + * permissions. This is not an instruction access, so
> + * it requires read permissions.
> + */
> + if (!(vma->vm_flags & VM_READ))
> + return 1;
> + }

Except for the above nit: Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

\
 
 \ /
  Last update: 2016-01-08 21:41    [W:0.231 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site