AFLplusplus / LibAFL

Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, ...
Other
2.03k stars 319 forks source link

MacOS frida ASAN fix #2510

Closed mineo333 closed 1 month ago

mineo333 commented 2 months ago

This patch makes startup on MacOS significantly faster as well as fixes some bugs. The way we increase the speed by stopping at the shadow region as well as it is the highest possible relevant region.

We also remove TLS tracking on darwin systems as TLS regions are allocated on the heap.

s1341 commented 2 months ago

You did a lot of other changes, in addition to the memory enumeration changes.

Can you please redo the PR as only the memory enumeration changes?

mineo333 commented 2 months ago

@s1341 I've tried to remove most of the unnecessary changes, but I've found that these are necessary as otherwise either the tests won't build/pass or the example fuzzers won't build.

domenukk commented 2 months ago

@s1341 @mineo333 status? :)

s1341 commented 2 months ago

@domenukk waiting for @mineo333 to respond to last review.

mineo333 commented 2 months ago

Sorry, been fairly busy for the last few days. Gonna try to wrap it up today.

s1341 commented 2 months ago

no worries.

mineo333 commented 2 months ago

The new solution basically uses the darwin API directly instead of going through Frida. The main reason why Frida is so slow is because, internally, gum_process_enumerate_ranges calls gum_darwin_fill_file_mapping which calls __proc_info which is incredibly slow.

domenukk commented 1 month ago

@s1341 looks good?