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: <20250113175552.GGZ4VTqHVuecaEhsax@fat_crate.local>
Date: Mon, 13 Jan 2025 18:55:52 +0100
From: Borislav Petkov <bp@...en8.de>
To: Mike Rapoport <rppt@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>, x86@...nel.org
Cc: Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Andy Lutomirski <luto@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
	Marek Marczykowski-Górecki <marmarek@...isiblethingslab.com>
Subject: Re: [PATCH] x86/execmem: fix ROX cache usage in Xen PV guests

On Fri, Jan 10, 2025 at 12:02:38PM +0200, Mike Rapoport wrote:
> On Fri, Jan 03, 2025 at 02:00:44PM +0100, Borislav Petkov wrote:
> > Adding the author in Fixes to Cc
> 
> Thanks, Boris!
>  
> > On Fri, Jan 03, 2025 at 07:56:31AM +0100, Juergen Gross wrote:
> > > The recently introduced ROX cache for modules is assuming large page
> > > support in 64-bit mode without testing the related feature bit. This
> > > results in breakage when running as a Xen PV guest, as in this mode
> > > large pages are not supported.
> 
> The ROX cache does not assume support for large pages, it just had a bug
> when dealing with base pages and the patch below should fix it.
> 
> Restricting ROX cache only for configurations that support large pages
> makes sense on it's own because there's no real benefit from the cache on
> such systems, but it does not fix the issue but rather covers it up.
> 
> diff --git a/mm/execmem.c b/mm/execmem.c
> index be6b234c032e..0090a6f422aa 100644
> --- a/mm/execmem.c
> +++ b/mm/execmem.c
> @@ -266,6 +266,7 @@ static int execmem_cache_populate(struct execmem_range *range, size_t size)
>  	unsigned long vm_flags = VM_ALLOW_HUGE_VMAP;
>  	struct execmem_area *area;
>  	unsigned long start, end;
> +	unsigned int page_shift;
>  	struct vm_struct *vm;
>  	size_t alloc_size;
>  	int err = -ENOMEM;
> @@ -296,8 +297,9 @@ static int execmem_cache_populate(struct execmem_range *range, size_t size)
>  	if (err)
>  		goto err_free_mem;
>  
> +	page_shift = get_vm_area_page_order(vm) + PAGE_SHIFT;
>  	err = vmap_pages_range_noflush(start, end, range->pgprot, vm->pages,
> -				       PMD_SHIFT);
> +				       page_shift);
>  	if (err)
>  		goto err_free_mem;
>  
> -- 

So this patch is still being discussed here.

akpm has already picked up the original fix from Jürgen:

59f59108475e ("x86/execmem: fix ROX cache usage in Xen PV guests")

and the patch is already in Linus' tree.

How much of a fiasco is this execmem thing going to become?

Andrew, is there any chance we can synchronize on what you pick up for
arch/x86/ or?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ