Skip to content

Commit

Permalink
fix qemu systemmode fuzzers exit code (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmalmain committed May 2, 2024
1 parent ec944a0 commit 02ef0c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fuzzers/qemu_systemmode/src/fuzzer_breakpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{env, path::PathBuf, process};

use libafl::{
corpus::{Corpus, InMemoryCorpus, OnDiskCorpus},
events::{launcher::Launcher, EventConfig},
events::{launcher::Launcher, EventConfig, CTRL_C_EXIT},
executors::ExitKind,
feedback_or, feedback_or_fast,
feedbacks::{CrashFeedback, MaxMapFeedback, TimeFeedback, TimeoutFeedback},
Expand Down Expand Up @@ -133,7 +133,7 @@ pub fn fuzz() {
}
HandlerResult::EndOfRun(exit_kind) => return exit_kind,
HandlerResult::Interrupted => {
std::process::exit(0);
std::process::exit(CTRL_C_EXIT);
}
},
Err(handler_error) => match handler_error {
Expand Down
4 changes: 2 additions & 2 deletions fuzzers/qemu_systemmode/src/fuzzer_classic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{env, path::PathBuf, process};

use libafl::{
corpus::{Corpus, InMemoryCorpus, OnDiskCorpus},
events::{launcher::Launcher, EventConfig},
events::{launcher::Launcher, EventConfig, CTRL_C_EXIT},
executors::ExitKind,
feedback_or, feedback_or_fast,
feedbacks::{CrashFeedback, MaxMapFeedback, TimeFeedback, TimeoutFeedback},
Expand Down Expand Up @@ -127,7 +127,7 @@ pub fn fuzz() {
Ok(QemuExitReason::Breakpoint(_)) => {}
Ok(QemuExitReason::End(QemuShutdownCause::HostSignal(
Signal::SigInterrupt,
))) => process::exit(0),
))) => process::exit(CTRL_C_EXIT),
Err(QemuExitReasonError::UnexpectedExit) => return ExitKind::Crash,
_ => panic!("Unexpected QEMU exit."),
}
Expand Down
4 changes: 2 additions & 2 deletions fuzzers/qemu_systemmode/src/fuzzer_sync_exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{env, path::PathBuf, process};

use libafl::{
corpus::{Corpus, InMemoryCorpus, OnDiskCorpus},
events::{launcher::Launcher, EventConfig},
events::{launcher::Launcher, EventConfig, CTRL_C_EXIT},
executors::ExitKind,
feedback_or, feedback_or_fast,
feedbacks::{CrashFeedback, MaxMapFeedback, TimeFeedback, TimeoutFeedback},
Expand Down Expand Up @@ -74,7 +74,7 @@ pub fn fuzz() {
HandlerResult::EndOfRun(exit_kind) => exit_kind,
HandlerResult::Interrupted => {
println!("Interrupted.");
std::process::exit(0);
std::process::exit(CTRL_C_EXIT);
}
},
Err(handler_error) => match handler_error {
Expand Down

0 comments on commit 02ef0c4

Please sign in to comment.