diff --git a/Cargo.lock b/Cargo.lock index c4257c2b1..128abf34d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,9 +547,9 @@ dependencies = [ [[package]] name = "linux-loader" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85feaf25cc99be9662ab951bc68a10ae4436dbc9ba931b7fcb4e8fde67d9aa24" +checksum = "62a2f912deca034ec34b0a43a390059ea98daac40e440ebe8bea88f3315fe168" dependencies = [ "vm-memory", ] diff --git a/arch/Cargo.toml b/arch/Cargo.toml index 3a762eaf0..3234037d3 100644 --- a/arch/Cargo.toml +++ b/arch/Cargo.toml @@ -13,7 +13,7 @@ anyhow = "1.0.65" byteorder = "1.4.3" hypervisor = { path = "../hypervisor" } libc = "0.2.133" -linux-loader = { version = "0.5.0", features = ["elf", "bzimage", "pe"] } +linux-loader = { version = "0.6.0", features = ["elf", "bzimage", "pe"] } log = "0.4.17" serde = { version = "1.0.145", features = ["rc", "derive"] } thiserror = "1.0.35" diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index d3ce93728..a9fcca0e1 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -29,7 +29,7 @@ gdbstub = { version = "0.6.3", optional = true } gdbstub_arch = { version = "0.2.4", optional = true } hypervisor = { path = "../hypervisor" } libc = "0.2.133" -linux-loader = { version = "0.5.0", features = ["elf", "bzimage", "pe"] } +linux-loader = { version = "0.6.0", features = ["elf", "bzimage", "pe"] } log = "0.4.17" micro_http = { git = "https://github.com/firecracker-microvm/micro-http", branch = "main" } net_util = { path = "../net_util" } diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index a824449b9..294245f69 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -1306,7 +1306,7 @@ impl Vm { arch::configure_system( &mem, - cmdline.as_str(), + cmdline.as_cstring().unwrap().to_str().unwrap(), vcpu_mpidrs, vcpu_topology, device_info, @@ -1992,8 +1992,11 @@ impl Vm { let cmdline = Self::generate_cmdline( self.config.lock().unwrap().payload.as_ref().unwrap(), )?; - mem.write_slice(cmdline.as_str().as_bytes(), GuestAddress(section.address)) - .unwrap(); + mem.write_slice( + cmdline.as_cstring().unwrap().as_bytes_with_nul(), + GuestAddress(section.address), + ) + .unwrap(); } _ => {} }