 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxc/x86: do not unconditionally set the module cmdline address
 commit fb5ab45739c6b3e410bd51d04b1e6d7b032ea1b2
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Wed Mar 28 12:55:16 2018 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed Mar 28 13:54:46 2018 +0100
    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é <roger.pau@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 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++;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |