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: <CAKv+Gu-xAAd=xTOh+qZvPDthgbRPLy=YwT4xfi4dS53EgJRh1Q@mail.gmail.com>
Date:	Mon, 14 Sep 2015 11:09:25 +0200
From:	Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:	Shannon Zhao <zhaoshenglong@...wei.com>
Cc:	Daniel Kiper <daniel.kiper@...cle.com>,
	Stefano Stabellini <stefano.stabellini@...citrix.com>,
	Mark Rutland <mark.rutland@....com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
	"Ian.Campbell@...rix.com" <Ian.Campbell@...rix.com>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"leif.lindholm@...aro.org" <leif.lindholm@...aro.org>,
	"xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
	"julien.grall@...rix.com" <julien.grall@...rix.com>,
	"freebsd-arm@...ebsd.org" <freebsd-arm@...ebsd.org>,
	"matt.fleming@...el.com" <matt.fleming@...el.com>,
	"christoffer.dall@...aro.org" <christoffer.dall@...aro.org>,
	"jbeulich@...e.com" <jbeulich@...e.com>,
	"peter.huangpeng@...wei.com" <peter.huangpeng@...wei.com>,
	"shannon.zhao@...aro.org" <shannon.zhao@...aro.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: Re: [PATCH] efi/libstub/fdt: Standardize the names of EFI stub parameters

On 14 September 2015 at 10:42, Shannon Zhao <zhaoshenglong@...wei.com> wrote:
[..]

>
> It only needs to apply following patch to fix a bug in Linux kernel when
> mapping EFI_MEMORY_RUNTIME memory.
>

Could you explain why you think efi_virtmap_init() should fail if
there are no EFI_MEMORY_RUNTIME regions?

The absence of such regions is allowed by the spec, so
efi_virtmap_init() is correct imo to return success.

If you are trying to work around the issue where Xen does not expose
any Runtime Services regions, there is simply no way to do that and be
still UEFI compliant. I have suggested before that we should perhaps
tolerate this anyway, by considering the case where the EFI System
Table has a NULL runtime services pointer. But rigging
efi_virtmap_init() like this is really not the way to achieve that.

-- 
Ard.


> Author: Shannon Zhao <shannon.zhao@...aro.org>
> Date:   Thu Aug 20 14:54:58 2015 +0800
>
>     arm64/efi: Fix a bug when no EFI_MEMORY_RUNTIME memory found
>
>     Currently if the attribute type of all the EFI Memory Descriptors are
>     not EFI_MEMORY_RUNTIME, efi_virtmap_init will return true. But at this
>     case, it expect false as there are no EFI memory for RUNTIME. Fix it by
>     introducing a status to show whether it finds EFI_MEMORY_RUNTIME.
>
>     Signed-off-by: Shannon Zhao <shannon.zhao@...aro.org>
>
> diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
> index e8ca6ea..bad7f87 100644
> --- a/arch/arm64/kernel/efi.c
> +++ b/arch/arm64/kernel/efi.c
> @@ -233,6 +233,7 @@ void __init efi_init(void)
>  static bool __init efi_virtmap_init(void)
>  {
>         efi_memory_desc_t *md;
> +       bool status = false;
>
>         for_each_efi_memory_desc(&memmap, md) {
>                 u64 paddr, npages, size;
> @@ -264,8 +265,11 @@ static bool __init efi_virtmap_init(void)
>                         prot = PAGE_KERNEL;
>
>                 create_pgd_mapping(&efi_mm, paddr, md->virt_addr, size,
> prot);
> +               status = true;
>         }
> -       return true;
> +       if (status)
> +               return true;
> +       return false;
>  }
>
> --
> Shannon
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ