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: <tip-fb153dc53f0eb8e8ad6a69f773e44c2d12daa5d0@git.kernel.org>
Date:   Mon, 5 Jun 2017 10:10:23 -0700
From:   tip-bot for Jan Kiszka <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     hpa@...or.com, mingo@...nel.org, ard.biesheuvel@...aro.org,
        linux-kernel@...r.kernel.org, tglx@...utronix.de,
        matt@...eblueprint.co.uk, jan.kiszka@...mens.com,
        torvalds@...ux-foundation.org, peterz@...radead.org
Subject: [tip:efi/core] efi/capsule: Fix return code on failing kmap/vmap

Commit-ID:  fb153dc53f0eb8e8ad6a69f773e44c2d12daa5d0
Gitweb:     http://git.kernel.org/tip/fb153dc53f0eb8e8ad6a69f773e44c2d12daa5d0
Author:     Jan Kiszka <jan.kiszka@...mens.com>
AuthorDate: Fri, 2 Jun 2017 13:51:56 +0000
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 5 Jun 2017 17:50:37 +0200

efi/capsule: Fix return code on failing kmap/vmap

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>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Reviewed-by: Matt Fleming <matt@...eblueprint.co.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-efi@...r.kernel.org
Link: http://lkml.kernel.org/r/20170602135207.21708-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@...nel.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ