lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1601082043160.3575@nanos>
Date:	Fri, 8 Jan 2016 20:51:16 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Dave Hansen <dave@...1.net>
cc:	linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
	dave.hansen@...ux.intel.com, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org, keescook@...gle.com, luto@...capital.net
Subject: Re: [PATCH 31/31] x86, pkeys: execute-only support

On Wed, 6 Jan 2016, Dave Hansen wrote:
> 
> Signed-off-by: Dave Hansen <dave.hansen@...ux.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@...utronix.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ