-
Notifications
You must be signed in to change notification settings - Fork 105
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
Integrate LibFuzzer #267
Integrate LibFuzzer #267
Conversation
Based on the initial fuzzer runs, I think the ELF loader logic doesn't check for invalid ELF strictly yet. For example, this is one of the crashes produced by the fuzzer
This PR was also created based on the fuzzer's crash log. |
72918d9
to
72edab7
Compare
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.
Cppcheck (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
07fa043
to
adeed6e
Compare
08b2788
to
d8ff776
Compare
I tried to resolve most, but there are some that are hard to understand what the error is about, or, some don't make sense to fix (single exit point per function, use the output of fprintf, don't use |
298a641
to
014255a
Compare
cf877a6
to
fd38f85
Compare
11a5502
to
de4c34f
Compare
5ec3349
to
7b9fe83
Compare
7b9fe83
to
ddd0bc0
Compare
Rather than creating a separate standalone fuzzer program, we can explore the option of integrating the fuzzing components as a feature activated by a command-line option. This approach aims to minimize the necessary changes for fuzzer integration. If we opt for this method, we will need to address the linkage between the C++-based LibFuzzer and the existing C codebase. See |
c463882
to
a2c318b
Compare
I am not aware of how we can merge both My current understanding is that for the LibFuzzer to work, we will need to provide an implementation of If there is more information or hints for merging the fuzzer into the current binary, I am happy to learn! :) |
src/main.c
Outdated
char *optarg = args[idx + 1]; | ||
|
||
switch (opt) { | ||
case 's': // binary string |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
It seems that C-only source files are compatible with libFuzzer. e.g., libFuzzer-examples. |
56cbb36
to
9b68828
Compare
By leveraging the LLVM's LibFuzzer, we will be able to test our emulator code more thoroughly. The seed corpus being added automatically are all the elf files in the build folder. Major changes: - Conditional compilation for the main function, as the fuzzer will generate its own main function - Need to use the clang toolchain - Introduce loading buffer as elf file, as the input from fuzzer will be passed into the emulator directly instead of going through a file - Fixed ELF verification logic as the fuzzer already breaks the code Other minor changes are: - Fix Codacy issue "rejecting SARIF, as there are more runs than allowed"
9b68828
to
6657edb
Compare
I am closing this pull request because we have not made a clear decision on how we can effectively utilize libFuzzer to identify potential issues. |
By leveraging the LLVM's LibFuzzer, we will be able to test our emulator code more thoroughly.
The seed corpus being added automatically are all the elf files in the build folder.
Major changes:
Minor changes:
Currently, known improvements are: