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: <56A75698.9080706@suse.com>
Date:	Tue, 26 Jan 2016 12:20:56 +0100
From:	Juergen Gross <jgross@...e.com>
To:	Jan Beulich <JBeulich@...e.com>, mingo@...e.hu,
	Thomas Gleixner <tglx@...utronix.de>, hpa@...or.com
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ix86: fix types used in pgprot cachability flags
 translations

On 26/01/16 12:15, Jan Beulich wrote:
> For PAE kernels "unsigned long" is not suitable to hold page protection
> flags, since _PAGE_NX doesn't fit there. This is the reason for quite a
> few W+X pages getting reported as insecure during boot (observed namely
> for the entire initrd range).
> 
> Fixes: 281d4078be ("x86: Make page cache mode a real type")
> Signed-off-by: Jan Beulich <jbeulich@...e.com>
> Cc: Juergen Gross <jgross@...e.com> 

Reviewed-by: Juergen Gross <jgross@...e.com>

> ---
> v2: Remove code enhancement part, as requested by tglx.
> ---
>  arch/x86/include/asm/pgtable_types.h |    9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> --- 4.5-rc1/arch/x86/include/asm/pgtable_types.h
> +++ 4.5-rc1-ix86-PAE-pgprot-xlat/arch/x86/include/asm/pgtable_types.h
> @@ -367,9 +367,8 @@ static inline enum page_cache_mode pgpro
>  static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot)
>  {
>  	pgprot_t new;
> -	unsigned long val;
> +	pgprotval_t val = pgprot_val(pgprot);
>  
> -	val = pgprot_val(pgprot);
>  	pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
>  		((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
>  	return new;
> @@ -377,9 +376,8 @@ static inline pgprot_t pgprot_4k_2_large
>  static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
>  {
>  	pgprot_t new;
> -	unsigned long val;
> +	pgprotval_t val = pgprot_val(pgprot);
>  
> -	val = pgprot_val(pgprot);
>  	pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
>  			  ((val & _PAGE_PAT_LARGE) >>
>  			   (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
> 
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ