[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu_ebG0Pji4QHdNPOZQoLGb0BaS4e+R6mcjJihuJ=JRxaw@mail.gmail.com>
Date: Fri, 24 Mar 2017 18:14:31 +0000
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: Jan Kiszka <jan.kiszka@...mens.com>
Cc: Matt Fleming <matt@...eblueprint.co.uk>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andy.shevchenko@...il.com>,
"Bryan O'Donoghue" <pure.logic@...us-software.ie>,
Hock Leong Kweh <hock.leong.kweh@...el.com>,
Borislav Petkov <bp@...en8.de>,
Sascha Weisenberger <sascha.weisenberger@...mens.com>
Subject: Re: [PATCH v2 1/7] efi/capsule: Fix return code on failing kmap/vmap
On 24 March 2017 at 17:34, Jan Kiszka <jan.kiszka@...mens.com> wrote:
> If kmap or vmap fail, it means we ran out of memory. There are no
> user-provided addressed involved that would justify EFAULT.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
> ---
> drivers/firmware/efi/capsule-loader.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
> index 9ae6c11..91e91f7 100644
> --- a/drivers/firmware/efi/capsule-loader.c
> +++ b/drivers/firmware/efi/capsule-loader.c
> @@ -113,7 +113,7 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
> VM_MAP, PAGE_KERNEL);
> if (!cap_hdr_temp) {
> pr_debug("%s: vmap() failed\n", __func__);
> - return -EFAULT;
> + return -ENOMEM;
> }
>
> ret = efi_capsule_update(cap_hdr_temp, cap_info->pages);
> @@ -185,7 +185,7 @@ static ssize_t efi_capsule_write(struct file *file, const char __user *buff,
> kbuff = kmap(page);
> if (!kbuff) {
> pr_debug("%s: kmap() failed\n", __func__);
> - ret = -EFAULT;
> + ret = -ENOMEM;
> goto failed;
> }
> kbuff += PAGE_SIZE - cap_info->page_bytes_remain;
> --
> 2.10.2
>
Powered by blists - more mailing lists