x86/PVHv2: fix dereference of native RSDP table mapping
PATCH 1/1 x86/PVHv2: fix dereference of native RSDP table mapping
Check that the RSDP is mapped before trying to access it.
Spotted-by Coverity
Signed-off-by Roger Pau Monné <[email protected]>
---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
--- xen/arch/x86/domain_build.c | 5 +++++ 1 file changed, 5 insertions(+)
xen/arch/x86/domain_build.c +5 -0
@@ -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;
Signature · 7 lines
2.10.1 (Apple Git-78) _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 4 lines · Roger Pau Monne
Check that the RSDP is mapped before trying to access it.
Spotted-by CoveritySigned-off-by Roger Pau Monné <[email protected]>
Reviewed-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel