From: Matt Fleming <matt@codeblueprint.co.uk>
To: Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>
Cc: Jan Beulich <JBeulich@suse.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
Matt Fleming <matt@codeblueprint.co.uk>,
Jan Beulich <jbeulich@suse.com>, Jiri Slaby <jslaby@suse.cz>,
lists@ssl-mail.com, Mark Rutland <mark.rutland@arm.com>,
stable@vger.kernel.org, Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: [PATCH 1/6] efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen
Date: Fri, 19 Aug 2016 21:34:59 +0100 [thread overview]
Message-ID: <1471638904-3494-2-git-send-email-matt@codeblueprint.co.uk> (raw)
In-Reply-To: <1471638904-3494-1-git-send-email-matt@codeblueprint.co.uk>
From: Jan Beulich <JBeulich@suse.com>
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@ssl-mail.com>
Tested-by: <lists@ssl-mail.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Jan Beulich <jbeulich@suse.com>
[ Guard the loop with a NULL check instead of pointer underflow ]
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
include/linux/efi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 7f5a58225385..23cd3ced8c1a 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -946,7 +946,7 @@ extern int efi_memattr_apply_permissions(struct mm_struct *mm,
/* 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)
/**
--
2.7.3
next prev parent reply other threads:[~2016-08-19 20:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 20:34 [GIT PULL 0/6] EFI urgent fixes Matt Fleming
2016-08-19 20:34 ` Matt Fleming [this message]
2016-08-19 20:35 ` [PATCH 2/6] efi/libstub: Allocate headspace in efi_get_memory_map() Matt Fleming
2016-08-22 16:37 ` Ingo Molnar
2016-08-19 20:35 ` [PATCH 3/6] efi/libstub: Introduce ExitBootServices helper Matt Fleming
[not found] ` <1471638904-3494-4-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-08-22 16:41 ` Ingo Molnar
2016-08-19 20:35 ` [PATCH 4/6] efi/libstub: Use efi_exit_boot_services() in FDT Matt Fleming
2016-08-22 16:43 ` Ingo Molnar
2016-08-19 20:35 ` [PATCH 5/6] x86/efi: Use efi_exit_boot_services() Matt Fleming
2016-08-19 20:35 ` [PATCH 6/6] efi/fdt: Fix handling error value in fdt_find_uefi_params Matt Fleming
2016-08-22 16:45 ` Ingo Molnar
[not found] ` <20160822164508.GD11327-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-30 10:07 ` Matt Fleming
[not found] ` <20160830100742.GA32579-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-08-30 10:41 ` [PATCH v2] efi: fix " Andrzej Hajda
[not found] ` <1472553697-27984-1-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-09-05 10:27 ` Matt Fleming
-- strict thread matches above, loose matches on Subject: below --
2016-09-05 14:42 [GIT PULL v2 0/6] EFI urgent fixes Matt Fleming
[not found] ` <20160905144237.2361-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-09-05 14:42 ` [PATCH 1/6] efi: Make for_each_efi_memory_desc_in_map() cope with running on Xen Matt Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471638904-3494-2-git-send-email-matt@codeblueprint.co.uk \
--to=matt@codeblueprint.co.uk \
--cc=JBeulich@suse.com \
--cc=ard.biesheuvel@linaro.org \
--cc=hpa@zytor.com \
--cc=jslaby@suse.cz \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lists@ssl-mail.com \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).