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]
Date:   Wed, 6 Nov 2019 18:01:54 +0100
From:   Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:     Anshuman Khandual <anshuman.khandual@....com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-efi <linux-efi@...r.kernel.org>
Subject: Re: [PATCH] efi: Return EFI_RESERVED_TYPE in efi_mem_type() for
 absent addresses

On Tue, 5 Nov 2019 at 21:39, Anshuman Khandual
<anshuman.khandual@....com> wrote:
>
> The function efi_mem_type() is expected (per documentation above) to return
> EFI_RESERVED_TYPE when a given physical address is not present in the EFI
> memory map. Even though EFI_RESERVED_TYPE is not getting checked explicitly
> anywhere in the callers, it is always better to return expected values.
>
> Cc: Ard Biesheuvel <ard.biesheuvel@...aro.org>
> Cc: linux-efi@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>

This reverts commit f99afd08a45fbbd9ce35a7624ffd1d850a1906c0.

Could you explain why it is better to fix the code than fix the comment?

> ---
>  drivers/firmware/efi/efi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 69f00f7453a3..bdda90a4601e 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -914,7 +914,7 @@ int efi_mem_type(unsigned long phys_addr)
>                                   (md->num_pages << EFI_PAGE_SHIFT))))
>                         return md->type;
>         }
> -       return -EINVAL;
> +       return EFI_RESERVED_TYPE;
>  }
>  #endif
>
> --
> 2.20.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ