rust-fuzz / targets

🎯 A collection of fuzzing targets written in Rust.
Creative Commons Zero v1.0 Universal
104 stars 21 forks source link

Add timeout feature to AFL #107

Closed killercup closed 4 years ago

killercup commented 6 years ago

otherwise running AFL in continuous mode is quite pointless

divergentdave commented 4 years ago

I took a crack at implementing this, but I think it will require upstream changes in afl.rs. Sending SIGTERM to the cargo-afl child process doesn't work, because it exits and the afl-fuzz process it launched keeps running. Sending SIGTERM to a process group would not work either, because cli, cargo-afl, and afl-fuzz are all in the same process group, and I think cli would exit as well. The two possible solutions I see are to either rewrite cargo-afl to use exec instead of spawning child processes, or add a command line argument and timeout logic to cargo-afl, so that it can send SIGTERM to afl-fuzz itself. (I prefer the second)