From fb5ab45739c6b3e410bd51d04b1e6d7b032ea1b2 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Wed, 28 Mar 2018 12:55:16 +0100 Subject: [PATCH] libxc/x86: do not unconditionally set the module cmdline address MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will lead to writing a wrong module command line physical memory address if no command line is actually provided. This hasn't caused problems so far because hvmloader is the only consumer of the modules command line, and it's unconditionally set in that case. Signed-off-by: Roger Pau Monné Acked-by: Wei Liu --- tools/libxc/xc_dom_x86.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c index f4bacb9e28..8784d1aa7d 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xc_dom_x86.c @@ -1653,11 +1653,10 @@ static void add_module_to_list(struct xc_dom_image *dom, < HVMLOADER_MODULE_CMDLINE_SIZE); strncpy(modules_cmdline_start + HVMLOADER_MODULE_CMDLINE_SIZE * index, cmdline, HVMLOADER_MODULE_CMDLINE_SIZE); + modlist[index].cmdline_paddr = modules_cmdline_paddr + + HVMLOADER_MODULE_CMDLINE_SIZE * index; } - modlist[index].cmdline_paddr = - modules_cmdline_paddr + HVMLOADER_MODULE_CMDLINE_SIZE * index; - start_info->nr_modules++; } -- 2.39.5