libxl: Use zero-ed memory for PVH acpi tables

xl/libxl memory is leaking into a PVH guest through uninitialized
portions of the ACPI tables.

Use libxl_zalloc() to obtain zero-ed memory to avoid this issue.

This is XSA-464 / CVE-2024-45819.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Fixes: 14c0d328da ("libxl/acpi: Build ACPI tables for HVMlite guests")
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 0bfe567b58
master date: 2024-11-12 13:32:45 +0100
This commit is contained in:
Jason Andryuk authored and Jan Beulich committed 2024-11-12 14:15:02 +01:00
1 parent 1eb843cd24
commit 78f66ae66f
1 file changed
+4 -3
+4 -3
View File
@@ -176,10 +176,11 @@ int libxl__dom_load_acpi(libxl__gc *gc,
goto out; goto out;
} }
config.rsdp = (unsigned long)libxl__malloc(gc, libxl_ctxt.page_size); /* These are all copied into guest memory, so use zero-ed memory. */
config.infop = (unsigned long)libxl__malloc(gc, libxl_ctxt.page_size); config.rsdp = (unsigned long)libxl__zalloc(gc, libxl_ctxt.page_size);
config.infop = (unsigned long)libxl__zalloc(gc, libxl_ctxt.page_size);
/* Pages to hold ACPI tables */ /* Pages to hold ACPI tables */
libxl_ctxt.buf = libxl__malloc(gc, NUM_ACPI_PAGES * libxl_ctxt.buf = libxl__zalloc(gc, NUM_ACPI_PAGES *
libxl_ctxt.page_size); libxl_ctxt.page_size);
/* /*
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.