diff --git a/sh_script/fuzzing.sh b/sh_script/fuzzing.sh index 4af7586a..cff3f87b 100644 --- a/sh_script/fuzzing.sh +++ b/sh_script/fuzzing.sh @@ -8,7 +8,7 @@ readonly script_name=${0##*/} fuzz_folder=( "td-loader" - "td-shim-interface/src" + "td-shim-interface" "td-shim" ) diff --git a/sh_script/rudra.sh b/sh_script/rudra.sh index b88a5dfb..15f27aa0 100644 --- a/sh_script/rudra.sh +++ b/sh_script/rudra.sh @@ -25,7 +25,7 @@ paths=( "td-paging" "td-payload" "td-shim" - "td-shim-interface/src" + "td-shim-interface" "td-shim-tools" "tdx-tdcall" ) diff --git a/td-shim-interface/src/fuzz/Cargo.toml b/td-shim-interface/fuzz/Cargo.toml similarity index 93% rename from td-shim-interface/src/fuzz/Cargo.toml rename to td-shim-interface/fuzz/Cargo.toml index f1c617ba..7cd5e15d 100644 --- a/td-shim-interface/src/fuzz/Cargo.toml +++ b/td-shim-interface/fuzz/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "td-uefi-pi-fuzz" +name = "td-shim-interface-fuzz" version = "0.0.0" authors = ["Automatically generated"] publish = false @@ -15,7 +15,7 @@ afl = {version = "*", optional = true } r-efi = "3.2.0" arbitrary = "=1.1.3" -[dependencies.td-uefi-pi] +[dependencies.td-shim-interface] path = ".." # Prevent this from interfering with workspaces diff --git a/td-shim-interface/src/fuzz/fuzz_targets/afl_cfv_parser.rs b/td-shim-interface/fuzz/fuzz_targets/afl_cfv_parser.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/afl_cfv_parser.rs rename to td-shim-interface/fuzz/fuzz_targets/afl_cfv_parser.rs diff --git a/td-shim-interface/src/fuzz/fuzz_targets/afl_hob_parser.rs b/td-shim-interface/fuzz/fuzz_targets/afl_hob_parser.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/afl_hob_parser.rs rename to td-shim-interface/fuzz/fuzz_targets/afl_hob_parser.rs diff --git a/td-shim-interface/src/fuzz/fuzz_targets/afl_payload_parser.rs b/td-shim-interface/fuzz/fuzz_targets/afl_payload_parser.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/afl_payload_parser.rs rename to td-shim-interface/fuzz/fuzz_targets/afl_payload_parser.rs diff --git a/td-shim-interface/src/fuzz/fuzz_targets/cfv_parser.rs b/td-shim-interface/fuzz/fuzz_targets/cfv_parser.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/cfv_parser.rs rename to td-shim-interface/fuzz/fuzz_targets/cfv_parser.rs diff --git a/td-shim-interface/src/fuzz/fuzz_targets/fuzzlib.rs b/td-shim-interface/fuzz/fuzz_targets/fuzzlib.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/fuzzlib.rs rename to td-shim-interface/fuzz/fuzz_targets/fuzzlib.rs diff --git a/td-shim-interface/src/fuzz/fuzz_targets/hob_parser.rs b/td-shim-interface/fuzz/fuzz_targets/hob_parser.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/hob_parser.rs rename to td-shim-interface/fuzz/fuzz_targets/hob_parser.rs diff --git a/td-shim-interface/src/fuzz/fuzz_targets/payload_parser.rs b/td-shim-interface/fuzz/fuzz_targets/payload_parser.rs similarity index 100% rename from td-shim-interface/src/fuzz/fuzz_targets/payload_parser.rs rename to td-shim-interface/fuzz/fuzz_targets/payload_parser.rs diff --git a/td-shim-interface/src/fuzz/seeds/cfv_parser/cfv b/td-shim-interface/fuzz/seeds/cfv_parser/cfv similarity index 100% rename from td-shim-interface/src/fuzz/seeds/cfv_parser/cfv rename to td-shim-interface/fuzz/seeds/cfv_parser/cfv diff --git a/td-shim-interface/src/fuzz/seeds/hob_parser/hob_buffer b/td-shim-interface/fuzz/seeds/hob_parser/hob_buffer similarity index 100% rename from td-shim-interface/src/fuzz/seeds/hob_parser/hob_buffer rename to td-shim-interface/fuzz/seeds/hob_parser/hob_buffer diff --git a/td-shim-interface/src/fuzz/seeds/payload_parser/fv_buffer b/td-shim-interface/fuzz/seeds/payload_parser/fv_buffer similarity index 100% rename from td-shim-interface/src/fuzz/seeds/payload_parser/fv_buffer rename to td-shim-interface/fuzz/seeds/payload_parser/fv_buffer diff --git a/td-shim-interface/src/td_uefi_pi/fv.rs b/td-shim-interface/src/td_uefi_pi/fv.rs index e099f4f7..8c9f8797 100644 --- a/td-shim-interface/src/td_uefi_pi/fv.rs +++ b/td-shim-interface/src/td_uefi_pi/fv.rs @@ -210,7 +210,7 @@ mod test { #[test] fn test_get_image_from_fv() { - let bytes = include_bytes!("../fuzz/seeds/payload_parser/fv_buffer"); + let bytes = include_bytes!("../../fuzz/seeds/payload_parser/fv_buffer"); let res = get_image_from_fv(bytes, FV_FILETYPE_DXE_CORE, SECTION_PE32); @@ -239,7 +239,7 @@ mod test { #[test] fn test_get_image_from_fv_with_wrong_fv_file_type() { - let bytes = include_bytes!("../fuzz/seeds/payload_parser/fv_buffer"); + let bytes = include_bytes!("../../fuzz/seeds/payload_parser/fv_buffer"); // Cannot find fv file type FV_FILETYPE_PEI_CORE let res = get_image_from_fv(bytes, FV_FILETYPE_PEI_CORE, SECTION_PE32); @@ -249,7 +249,7 @@ mod test { #[test] fn test_get_image_from_fv_with_wrong_section_type() { - let bytes = include_bytes!("../fuzz/seeds/payload_parser/fv_buffer"); + let bytes = include_bytes!("../../fuzz/seeds/payload_parser/fv_buffer"); // Cannot find section type SECTION_PIC let res = get_image_from_fv(bytes, FV_FILETYPE_DXE_CORE, SECTION_PIC); @@ -259,7 +259,7 @@ mod test { #[test] fn test_get_file_from_fv() { - let bytes = include_bytes!("../fuzz/seeds/cfv_parser/cfv"); + let bytes = include_bytes!("../../fuzz/seeds/cfv_parser/cfv"); let res = get_file_from_fv(bytes, FV_FILETYPE_RAW, TEST_GUID1); @@ -288,7 +288,7 @@ mod test { #[test] fn test_get_file_from_fv_with_wrong_guid() { - let bytes = include_bytes!("../fuzz/seeds/cfv_parser/cfv"); + let bytes = include_bytes!("../../fuzz/seeds/cfv_parser/cfv"); // Cannot find this GUID let res = get_file_from_fv(bytes, FV_FILETYPE_RAW, TEST_GUID2); diff --git a/td-shim-interface/src/td_uefi_pi/hob.rs b/td-shim-interface/src/td_uefi_pi/hob.rs index 50bba808..e05775c5 100644 --- a/td-shim-interface/src/td_uefi_pi/hob.rs +++ b/td-shim-interface/src/td_uefi_pi/hob.rs @@ -481,7 +481,7 @@ mod tests { #[test] fn test_check_hob_integrity() { const EFI_END_OF_HOB_LIST_OFFSET: usize = 48; - let hob = &include_bytes!("../fuzz/seeds/hob_parser/hob_buffer")[..]; + let hob = &include_bytes!("../../fuzz/seeds/hob_parser/hob_buffer")[..]; let mut test_hob = hob.to_vec(); let ptr = test_hob.as_ptr() as u64; if test_hob.len() >= size_of::() { @@ -495,14 +495,14 @@ mod tests { #[test] fn test_get_total_memory_top() { - let hob = &include_bytes!("../fuzz/seeds/hob_parser/hob_buffer")[..]; + let hob = &include_bytes!("../../fuzz/seeds/hob_parser/hob_buffer")[..]; assert!(get_total_memory_top(hob).is_some()); } #[test] fn test_seek_to_next_hob() { - let hob = &include_bytes!("../fuzz/seeds/hob_parser/hob_buffer")[..]; + let hob = &include_bytes!("../../fuzz/seeds/hob_parser/hob_buffer")[..]; assert!(seek_to_next_hob(hob).is_some()); }