-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Proposed fix for #3094, issue with trace-cmp #3095
Conversation
…arisons are treat as 1 byte (rather than 2, 4, or 8)
One of the CI fuzzers doesn't find any objectives now(?) |
Hmm, looks like it passed this time but got |
@tokatoka can you take a look plz :) |
which fuzzer is this about? |
yeah it looks good |
This deserves a fuzzbench run. Should I fire this off locally? |
yeah |
Okay, I'll just run like 3 trials for 6 hours, this difference should be plain by this alone. |
but you have to change fuzzbench/src/lib.rs |
Here's a minimal recreator from the test case I was using: struct Data {
uint16_t first;
uint32_t second;
} __attribute__((packed));
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < sizeof(struct Data)) {
return 0;
}
struct Data* data = (struct Data*) Data;
// XOR so value profiles are needed, comparison logging not enough.
if ((data->first ^ 0xdead) == 0xbeef &&
(data->second ^ 0xdeadbeef) == 0xaabbccdd) {
abort();
}
return 0;
} I can confirm that with this change it is found successfully by libafl-libfuzzer whereas before it couldn't! $ ./libafl-libfuzzer -use_value_profile=1
[Testcase #0] (GLOBAL) run time: 0h-0m-1s, clients: 1, corpus: 22, objectives: 0, executions: 0, exec/sec: 0.000, cmps: 0.037%, edges: 80.000%, size_edges: 80.000%, stability: 100.000%
(CLIENT) corpus: 22, objectives: 0, executions: 0, exec/sec: 0.000, cmps: 3/8192 (0%), edges: 4/5 (80%), size_edges: 4/5 (80%), stability: 3/3 (100%)
[2025-03-20T15:20:32Z ERROR libafl::executors::hooks::unix::unix_signal_handler] Crashed with SIGABRT
[2025-03-20T15:20:32Z ERROR libafl::executors::hooks::unix::unix_signal_handler] Child crashed!
[2025-03-20T15:20:32Z ERROR libafl::executors::hooks::unix::unix_signal_handler] input: "ee0ec739bda2f018" |
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.
Semantic change looks good and passes test. No opinion on the unrelated formatting stuff, maybe a LibAFL maintainer can chime in on that.
format is fine. as long as ci doesn't complain i don't care |
@addisoncrump you've run it? |
Description
There is an issue with one of the macros for generating
__libafl_targets_value_profileX
calls, which resulted in all instances calling__libafl_targets_value_profile1
- meaning that only 1 byte of the conditional check got passed through.@ammaraskar: you said that you found the bug due to some unexpected results (not being able to break through magic numbers); any chance you can rerun your setup and see if this fixes it?
Also: not sure if the formatter setup has changed or what - let me know if you'd prefer I remove the whitespace changes from this PR and create a new one after. Only
libafl_targets/src/sancov_cmp.c:17
has changed semantically.Checklist
./scripts/precommit.sh
and addressed all comments