xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/PVHv2: fix dereference of native RSDP table mapping
@ 2017-02-27 12:14 Roger Pau Monne
  2017-02-27 13:20 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Pau Monne @ 2017-02-27 12:14 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Jan Beulich, Roger Pau Monne

Check that the RSDP is mapped before trying to access it.

Spotted-by: Coverity
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index d742965..78ae741 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -2592,6 +2592,11 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
 
     /* Craft a custom RSDP. */
     native_rsdp = acpi_os_map_memory(acpi_os_get_root_pointer(), sizeof(rsdp));
+    if ( !native_rsdp )
+    {
+        printk("Failed to map native RSDP\n");
+        return -ENOMEM;
+    }
     memcpy(rsdp.oem_id, native_rsdp->oem_id, sizeof(rsdp.oem_id));
     acpi_os_unmap_memory(native_rsdp, sizeof(rsdp));
     rsdp.xsdt_physical_address = xsdt_paddr;
-- 
2.10.1 (Apple Git-78)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-27 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-27 12:14 [PATCH] x86/PVHv2: fix dereference of native RSDP table mapping Roger Pau Monne
2017-02-27 13:20 ` Andrew Cooper

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).