@@ -1114,15 +1114,15 @@ void x86_load_linux(X86MachineState *x86ms,
setup_data->len = cpu_to_le32(RNG_SEED_LENGTH);
qemu_guest_getrandom_nofail(setup_data->data, RNG_SEED_LENGTH);
qemu_register_reset_nosnapshotload(reset_rng_seed, setup_data);
- fw_cfg_add_bytes_callback(fw_cfg, FW_CFG_KERNEL_DATA, reset_rng_seed, NULL,
- setup_data, kernel, kernel_size, true);
+ fw_cfg_add_bytes_callback(fw_cfg, FW_CFG_CMDLINE_DATA, reset_rng_seed, NULL,
+ setup_data, kernel_cmdline, cmdline_size, true);
} else {
- fw_cfg_add_bytes(fw_cfg, FW_CFG_KERNEL_DATA, kernel, kernel_size);
+ fw_cfg_add_bytes(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline, cmdline_size);
}
+ fw_cfg_add_bytes(fw_cfg, FW_CFG_KERNEL_DATA, kernel, kernel_size);
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_ADDR, cmdline_addr);
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, cmdline_size);
- fw_cfg_add_bytes(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline, cmdline_size);
sev_load_ctx.cmdline_data = (char *)kernel_cmdline;
sev_load_ctx.cmdline_size = cmdline_size;
With eac7a7791bb6 ("x86: don't let decompressed kernel image clobber setup_data"), the rng seed setup_data is now appended to the cmdline file rather than the kernel image file. But in the process, the code to re-randomize the seed when selecting the image was left out. So, change the re-randomization over to trigger when selecting the cmdline, rather than the kernel image. Fixes: eac7a7791bb6 ("x86: don't let decompressed kernel image clobber setup_data") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> --- hw/i386/x86.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)