From 79c032dc6ec2d9d6534f3faf41094fad9ab22d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20L=C3=B3pez?= Date: Thu, 25 Jan 2024 15:43:40 +0100 Subject: [PATCH 1/2] fw_meta: do not panic on CPUID page absence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the CPUID page is absent simply log it and return an error instead of panicking. This was causing problems with the fw_meta fuzzer. Signed-off-by: Carlos López --- src/fw_meta.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fw_meta.rs b/src/fw_meta.rs index 2f7f9262b..77b376df7 100644 --- a/src/fw_meta.rs +++ b/src/fw_meta.rs @@ -251,7 +251,8 @@ pub fn parse_fw_meta_data(mem: &[u8]) -> Result { // Verify that the required elements are present. if meta_data.cpuid_page.is_none() { - panic!("FW does not specify CPUID_PAGE location"); + log::error!("FW does not specify CPUID_PAGE location"); + return Err(SvsmError::Firmware); } Ok(meta_data) From b5ce98a4531f73de6b12a7acf83272ec80677512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20L=C3=B3pez?= Date: Thu, 25 Jan 2024 15:44:13 +0100 Subject: [PATCH 2/2] fuzz: update Cargo.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update dependencies on crates in the parent directory. Signed-off-by: Carlos López --- fuzz/Cargo.lock | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 72dfd99d0..b8cfde194 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -69,6 +69,10 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +[[package]] +name = "bootlib" +version = "0.1.0" + [[package]] name = "byteorder" version = "1.5.0" @@ -101,6 +105,10 @@ dependencies = [ "inout", ] +[[package]] +name = "cpuarch" +version = "0.1.0" + [[package]] name = "cpufeatures" version = "0.2.11" @@ -172,10 +180,6 @@ dependencies = [ "zerocopy 0.7.31", ] -[[package]] -name = "igvm_params" -version = "0.1.0" - [[package]] name = "inout" version = "0.1.3" @@ -323,8 +327,9 @@ version = "0.1.0" dependencies = [ "aes-gcm", "bitflags", + "bootlib", + "cpuarch", "igvm_defs", - "igvm_params", "intrusive-collections", "log", "packit",