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: <20160922174054.494389781@linuxfoundation.org>
Date:   Thu, 22 Sep 2016 19:41:09 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     linux-kernel@...r.kernel.org
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        stable@...r.kernel.org, lists@...-mail.com,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Jiri Slaby <jslaby@...e.cz>,
        Mark Rutland <mark.rutland@....com>,
        Jan Beulich <jbeulich@...e.com>,
        Matt Fleming <matt@...eblueprint.co.uk>
Subject: [PATCH 4.7 135/184] efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen

4.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Beulich <JBeulich@...e.com>

commit d4c4fed08f31f3746000c46cb1b20bed2959547a upstream.

While commit 55f1ea15216 ("efi: Fix for_each_efi_memory_desc_in_map()
for empty memmaps") made an attempt to deal with empty memory maps, it
didn't address the case where the map field never gets set, as is
apparently the case when running under Xen.

Reported-by: <lists@...-mail.com>
Tested-by: <lists@...-mail.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Jiri Slaby <jslaby@...e.cz>
Cc: Mark Rutland <mark.rutland@....com>
Signed-off-by: Jan Beulich <jbeulich@...e.com>
[ Guard the loop with a NULL check instead of pointer underflow ]
Signed-off-by: Matt Fleming <matt@...eblueprint.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

---
 include/linux/efi.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1005,7 +1005,7 @@ extern int efi_memattr_apply_permissions
 /* Iterate through an efi_memory_map */
 #define for_each_efi_memory_desc_in_map(m, md)				   \
 	for ((md) = (m)->map;						   \
-	     ((void *)(md) + (m)->desc_size) <= (m)->map_end;		   \
+	     (md) && ((void *)(md) + (m)->desc_size) <= (m)->map_end;	   \
 	     (md) = (void *)(md) + (m)->desc_size)
 
 /**


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ