Skip to content

Add dump_pt_trace config parameter #30

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ pub struct FuzzerConfig {
pub write_protected_input_buffer: bool,
pub cow_primary_size: Option<u64>,
pub ipt_filters: [IptFilter;4],
pub target_hash: Option<[u8; 20]>
pub target_hash: Option<[u8; 20]>,
pub dump_pt_trace: bool,
}
impl FuzzerConfig{

Expand Down Expand Up @@ -200,6 +201,7 @@ impl FuzzerConfig{
config.ip3,
],
target_hash: target_hash,
dump_pt_trace: config.dump_pt_trace,
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions config/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ pub struct FuzzerConfigLoader {
pub snapshot_placement: Option<SnapshotPlacement>,
pub dump_python_code_for_inputs: Option<bool>,
pub exit_after_first_crash: Option<bool>,
#[serde(default = "default_dump_pt_trace")]
pub dump_pt_trace: bool,
}

fn default_dump_pt_trace() -> bool {
false
}

fn default_input_buffer_size() -> usize {
Expand Down
5 changes: 4 additions & 1 deletion fuzz_runner/src/nyx/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct QemuParams {

pub dump_python_code_for_inputs: bool,
pub write_protected_input_buffer: bool,
pub dump_pt_trace: bool,
pub cow_primary_size: Option<u64>,
pub hprintf_fd: Option<i32>,

Expand Down Expand Up @@ -100,6 +101,7 @@ impl QemuParams {
nyx_ops += &format!(",workdir={}", workdir);
nyx_ops += &format!(",sharedir={}", sharedir);
nyx_ops += &format!(",aux_buffer_size={}", fuzzer_config.runtime.aux_buffer_size());
nyx_ops += &format!(",dump_pt_trace={}", fuzzer_config.fuzz.dump_pt_trace);

let mut i = 0;
for filter in fuzzer_config.fuzz.ipt_filters{
Expand Down Expand Up @@ -196,7 +198,8 @@ impl QemuParams {
cow_primary_size: fuzzer_config.fuzz.cow_primary_size,
hprintf_fd: fuzzer_config.runtime.hprintf_fd(),
aux_buffer_size: fuzzer_config.runtime.aux_buffer_size(),
time_limit: fuzzer_config.fuzz.time_limit
time_limit: fuzzer_config.fuzz.time_limit,
dump_pt_trace: fuzzer_config.fuzz.dump_pt_trace,
}
}

Expand Down