-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Nalloc sanitizer: to test allocations failures #10701
base: master
Are you sure you want to change the base?
Conversation
catenacyber is a new contributor to projects/fluent-bit. The PR must be approved by known contributors before it can be merged. The past contributors are: jonathanmetzman, DavidKorczynski, leonardo-albertovich, patrick-stephens, oliverchang, devtty1er, edsiper |
@@ -72,6 +72,8 @@ ENV SANITIZER_FLAGS_thread "-fsanitize=thread" | |||
|
|||
ENV SANITIZER_FLAGS_introspector "-O0 -flto -fno-inline-functions -fuse-ld=gold -Wno-unused-command-line-argument" | |||
|
|||
ENV SANITIZER_FLAGS_nalloc "-DLLVMFuzzerTestOneInput=NaloFuzzerTestOneInput -DLLVMFuzzerInitialize=NaloFuzzerInitialize $SANITIZER_FLAGS_address" |
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.
This is the magic trick
Renaming LLVMFuzzerTestOneInput
by macro in order to hook before it
@@ -30,5 +30,6 @@ fi | |||
export RUN_FUZZER_MODE="interactive" | |||
export FUZZING_ENGINE="libfuzzer" | |||
export SKIP_SEED_CORPUS="1" | |||
export FUZZ_REPRODUCE_VERBOSE="1" |
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.
This is used by nalloc to be verbose about allocation failures when reproducing (it stays quiet during batch fuzzing)
@catenacyber , sorry for the silly question, but I am not able to test it locally (with nDPI). I have done:
It seems that nalloc stuff is never compiled... |
@IvanNardi you have to run |
And you also to run |
Now it works! Thank you very much! Astonishing work... |
Friendly ping @oliverchang Could we get this new "sanitizer" to test when allocations fail ? In addition to the projects listed here (see previous PR), there is also icu cf unicode-org/icu#2567 where a double free was found by nallocfuzz and is now fixed (and also curl cf curl/curl@22eb989 ) |
Friendly ping @oliverchang Could we get this new "sanitizer" to test when memory allocations fail ? |
#9902 but as a sanitizer instead of a fuzzing engine
cc @oliverchang @alan32liu
Is this less costly than a fuzzing engine ?