Skip to contentSkip to conversation

Patch "efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Sep 22, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen

to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
efi-make-for_each_efi_memory_desc_in_map-cope-with-running-on-xen.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From d4c4fed08f31f3746000c46cb1b20bed2959547a Mon Sep 17 00:00:00 2001

From: Jan Beulich <[email protected]>
Date: Mon, 15 Aug 2016 09:05:45 -0600
Subject: efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen

From: Jan Beulich <[email protected]>

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.

Cc Vitaly Kuznetsov <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Mark Rutland <[email protected]>
[ Guard the loop with a NULL check instead of pointer underflow ]
---
 include/linux/efi.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/efi.h +1 -1
@@ -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)
 
 /**

Patches currently in stable-queue which might be from [email protected] are

queue-4.7/efi-make-for_each_efi_memory_desc_in_map-cope-with-running-on-xen.patch