From: Roger Pau Monne Date: Wed, 28 Mar 2018 11:55:16 +0000 (+0100) Subject: libxc/x86: do not unconditionally set the module cmdline address X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~296 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fb5ab45739c6b3e410bd51d04b1e6d7b032ea1b2;p=xen.git libxc/x86: do not unconditionally set the module cmdline address 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 --- 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++; }