-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fix running AFL with no 'fuzzing' flag #398
Conversation
cargo-afl/src/bin/cargo-afl.rs
Outdated
@@ -310,7 +310,8 @@ where | |||
-C target-cpu=native " | |||
); | |||
|
|||
if cfg!(not(feature = "no_cfg_fuzzing")) { | |||
let no_cfg_fuzzing = env::var("AFL_NO_CFG_FUZZING").unwrap_or_default(); | |||
if no_cfg_fuzzing.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note from author:
Alternatively I was thinking also of adding else clause with:
- removing AFL_NO_CFG_FUZZING here
- setting config
no_fuzzing
and not adding env to the Command
in line 347.
It would be more elegant than this. But that no_fuzzing
config could be somehow confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, essentially, cargo-afl would turn the environment variable into a config option?
I think I like that idea.
That way, afl/build.rs should not need to consider AFL_
environment variables at all (right?).
Apologies, I am traveling (hence, the funny account) and the earliest I will be able to merge anything will be Monday evening ET.
EDIT: Edited to say "AFL_
environment variables" instead of just "environment variables".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, let's please use just .is_ok()
to check whether AFL_NO_CFG_FUZZING
is enabled. That is the convention used for other environment variables, currently.
README.md
Outdated
@@ -43,6 +43,9 @@ So if you run multiple AFL++ instances on your fuzzing target, you can disable C | |||
This [document](https://github.com/AFLplusplus/AFLplusplus/blob/stable/docs/fuzzing_in_depth.md) | |||
will familiarize you with AFL++ features to help in running a successful fuzzing campaign. | |||
|
|||
By default, 'fuzzing' config is set when `cargo-afl` is used to build. If you want to prevent this, just set 'AFL_NO_CFG_FUZZING=1` | |||
environmental variable, when building. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks,, @lrubasze!
Just one nit. Could this please read something like the following?
set the environment variable
AFL_NO_CFG_FUZZING
to1
when building.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My english really sucks 😄 Thanks for spotting this.
Thanks again, @lrubasze. 🙏 |
This is to address issue #397
In order to prevent
cargo-afl
from settingfuzzing
flag one needs to setAFL_NO_CFG_FUZZING
environmental variable.Eg.