Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move td-uefi-pi fuzz folder #670

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sh_script/fuzzing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readonly script_name=${0##*/}

fuzz_folder=(
"td-loader"
"td-shim-interface/src"
"td-shim-interface"
"td-shim"
)

Expand Down
2 changes: 1 addition & 1 deletion sh_script/rudra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ paths=(
"td-paging"
"td-payload"
"td-shim"
"td-shim-interface/src"
"td-shim-interface"
"td-shim-tools"
"tdx-tdcall"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[package]
name = "td-uefi-pi-fuzz"
name = "td-shim-interface-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions td-shim-interface/src/td_uefi_pi/fv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions td-shim-interface/src/td_uefi_pi/hob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<HandoffInfoTable>() {
Expand All @@ -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());
}
Expand Down
Loading