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] [day] [month] [year] [list]
Message-ID: <20170409222142.GA32464@codeblueprint.co.uk>
Date:   Sun, 9 Apr 2017 23:21:42 +0100
From:   Matt Fleming <matt@...eblueprint.co.uk>
To:     Omar Sandoval <osandov@...ndov.com>
Cc:     Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Dave Young <dyoung@...hat.com>, Ingo Molnar <mingo@...nel.org>,
        Peter Jones <pjones@...hat.com>, linux-kernel@...r.kernel.org,
        kernel-team@...com
Subject: Re: [PATCH] x86/efi: don't try to reserve runtime regions

On Tue, 04 Apr, at 04:41:55PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@...com>
> 
> Reserving a runtime region results in splitting the efi memory
> descriptors for the runtime region. This results in runtime region
> descriptors with bogus memory mappings, leading to interesting crashes
> like the following during a kexec:
 
[...]
 
> Runtime regions will not be freed and do not need to be reserved, so
> skip the memmap modification in this case.
> 
> Fixes: 8e80632fb23f ("efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()")
> Signed-off-by: Omar Sandoval <osandov@...com>
> ---
>  arch/x86/platform/efi/quirks.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
> index 30031d5293c4..cdfe8c628959 100644
> --- a/arch/x86/platform/efi/quirks.c
> +++ b/arch/x86/platform/efi/quirks.c
> @@ -201,6 +201,10 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
>  		return;
>  	}
>  
> +	/* No need to reserve regions that will never be freed. */
> +	if (md.attribute & EFI_MEMORY_RUNTIME)
> +		return;
> +
>  	size += addr % EFI_PAGE_SIZE;
>  	size = round_up(size, EFI_PAGE_SIZE);
>  	addr = round_down(addr, EFI_PAGE_SIZE);

Thanks Omar, I've picked this up for the urgent branch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ