You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents libafl-libfuzzer from being able to solve things like this little harness (full harness attached harness.cpp.txt):
extern"C"intLLVMFuzzerTestOneInput(constuint8_t*Data, size_tSize) {
if (Size==0) return0;
char*encoded= (char*) malloc(Size*3);
if (encoded==NULL) return0;
intb64_length=b64_encode((unsigned char*) Data, Size, (unsigned char*) encoded);
// "Hello " in base64 so it's not visible to cmplogif (strncmp(encoded, "SGVsbG8g", 8) ==0) {
// "World" in base64 so it's not visible to cmplogif (b64_length>8&&strncmp(encoded+b64_length-8, "V29ybGQ=", 8) ==0) {
abort();
}
}
free(encoded);
return0;
}
libfuzzer with value profiles can solve this rather easily because it breaks the strncmp into a brute-force of the base64 output:
$ time ./libfuzzer -use_value_profile=1
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3161432840
INFO: Loaded 1 modules (16 inline 8-bit counters): 16 [0x55a96f6e0fe1, 0x55a96f6e0ff1),
INFO: Loaded 1 PC tables (16 PCs): 16 [0x55a96f6e0ff8,0x55a96f6e10f8),
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2 INITED cov: 7 ft: 24 corp: 1/1b exec/s: 0 rss: 26Mb
...
0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,
Hello World
artifact_prefix='./'; Test unit written to ./crash-0a4d55a8d778e5022fab701977c5d840bbc486d0
Base64: SGVsbG8gV29ybGQ=
real 0m20.850s
user 0m20.556s
sys 0m0.068s
...
but using libafl's libfuzzer shim for the same thing:
Currently in libfuzzer, the hooks for strncmp,
__sanitizer_weak_hook_strncmp
calls into:and then
AddValueForMemcmp
in turn does these two calls:TORCW
is the comparison logging mechanism but notice it also hasValueProfileMap
guidance here.(same code in AFL++ here)
In comparison, the hook for strncmp in
libafl-targets
does:LibAFL/libafl_targets/src/sancov_cmp.rs
Line 92 in 89342b2
which in turn only adds the value to the cmplog map:
LibAFL/libafl_targets/src/cmplog.h
Lines 190 to 191 in 89342b2
This prevents libafl-libfuzzer from being able to solve things like this little harness (full harness attached harness.cpp.txt):
libfuzzer with value profiles can solve this rather easily because it breaks the strncmp into a brute-force of the base64 output:
but using libafl's libfuzzer shim for the same thing:
Notice there isn't an increase in
cmps
.The text was updated successfully, but these errors were encountered: