llvm-project/compiler-rt/lib/fuzzer
Sebastian Poeplau 70cbc6dbef [libFuzzer] Fix stack overflow detection
Address sanitizer can detect stack exhaustion via its SEGV handler, which is
executed on a separate stack using the sigaltstack mechanism. When libFuzzer is
used with address sanitizer, it installs its own signal handlers which defer to
those put in place by the sanitizer before performing additional actions. In the
particular case of a stack overflow, the current setup fails because libFuzzer
doesn't preserve the flag for executing the signal handler on a separate stack:
when we run out of stack space, the operating system can't run the SEGV handler,
so address sanitizer never reports the issue. See the included test for an
example.

This commit fixes the issue by making libFuzzer preserve the SA_ONSTACK flag
when installing its signal handlers; the dedicated signal-handler stack set up
by the sanitizer runtime appears to be large enough to support the additional
frames from the fuzzer.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D101824
2021-05-07 08:18:28 -07:00
..
afl [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
dataflow [DFSan] Add efficient fast16labels instrumentation mode. 2020-07-29 18:58:47 +00:00
scripts [libFuzzer] remove the data-flow-trace (DFT) python scripts; their functionality is now part of libFuzzer proper; also write functions.txt to the disk only if this file doesn't exist yet 2019-05-23 01:03:42 +00:00
standalone [libFuzzer] fix missing close on opened file 2019-02-26 19:33:00 +00:00
tests Expand unit tests for fuzzer::Merger 2021-02-12 11:18:34 -08:00
CMakeLists.txt [CMake] Avoid accidental C++ standard library dependency in sanitizers 2020-10-31 02:37:38 -07:00
FuzzerBuiltins.h [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerBuiltinsMsvc.h [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerCommand.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FuzzerCorpus.h [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerCrossOver.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FuzzerDataFlowTrace.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerDataFlowTrace.h [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerDefs.h Revert "[libFuzzer] Expose fuzzer::FuzzerDriver()" 2020-07-23 17:07:55 -07:00
FuzzerDictionary.h [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerDriver.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerExtFunctions.def [libFuzzer] Always print DSO map on Fuchsia libFuzzer launch 2019-09-17 00:34:41 +00:00
FuzzerExtFunctions.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FuzzerExtFunctionsDlsym.cpp [libFuzzer] Separate platform related macros out from FuzzerDefs.h into FuzzerPlatform.h, and adjust includes in other files. 2020-07-14 21:31:56 +00:00
FuzzerExtFunctionsWeak.cpp [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
FuzzerExtFunctionsWindows.cpp [libFuzzer] Separate platform related macros out from FuzzerDefs.h into FuzzerPlatform.h, and adjust includes in other files. 2020-07-14 21:31:56 +00:00
FuzzerExtraCounters.cpp [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
FuzzerFlags.def [fuzzer] Add Windows Visual C++ exception intercept 2020-11-12 13:11:14 -08:00
FuzzerFork.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerFork.h [libFuzzer] add threads to the fork mode: now you can pass -fork=N to run N concurrent workers. Fork mode is still work-in-progress. 2019-02-14 00:25:43 +00:00
FuzzerIO.cpp [fuzzer] Print reloaded file paths 2021-04-16 10:00:24 -07:00
FuzzerIO.h [fuzzer] Print reloaded file paths 2021-04-16 10:00:24 -07:00
FuzzerIOPosix.cpp [compiler-rt] Suppress -Wunused-result due to ::write when _FORTIFY_SOURCE>0 in glibc 2020-10-12 09:57:12 -07:00
FuzzerIOWindows.cpp [libFuzzer] Error and exit if user supplied fuzzer writeable directories don't exist 2020-08-26 09:27:07 -07:00
FuzzerInterceptors.cpp [libFuzzer] Break dependency on common_interface_defs.h 2020-09-01 15:35:14 -07:00
FuzzerInterface.h [libFuzzer][Windows] Use dllexport for all declarations in FuzzerInterface.h 2019-01-28 17:51:13 +00:00
FuzzerInternal.h [libFuzzer] Added -print_full_coverage flag. 2020-10-23 16:05:54 -07:00
FuzzerLoop.cpp [fuzzer] Print reloaded file paths 2021-04-16 10:00:24 -07:00
FuzzerMain.cpp [libFuzzer] Separate platform related macros out from FuzzerDefs.h into FuzzerPlatform.h, and adjust includes in other files. 2020-07-14 21:31:56 +00:00
FuzzerMerge.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerMerge.h [libFuzzer] Fixed description of fuzzer merge control file. 2020-05-29 16:00:26 -07:00
FuzzerMutate.cpp [libFuzzer] Preserve position hint in auto dictionary 2021-05-04 09:06:51 -07:00
FuzzerMutate.h [compiler-rt][NFC] Fix typo in comment 2020-11-02 13:05:03 +08:00
FuzzerOptions.h [fuzzer] Add Windows Visual C++ exception intercept 2020-11-12 13:11:14 -08:00
FuzzerPlatform.h [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
FuzzerRandom.h [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerSHA1.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerSHA1.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FuzzerTracePC.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerTracePC.h Tweak SimpleFastHash 2021-04-01 23:26:03 -07:00
FuzzerUtil.cpp Tweak SimpleFastHash 2021-04-01 23:26:03 -07:00
FuzzerUtil.h Tweak SimpleFastHash 2021-04-01 23:26:03 -07:00
FuzzerUtilDarwin.cpp [libFuzzer] Separate platform related macros out from FuzzerDefs.h into FuzzerPlatform.h, and adjust includes in other files. 2020-07-14 21:31:56 +00:00
FuzzerUtilFuchsia.cpp [crt][fuzzer] Fix up various numeric conversions 2021-03-11 16:01:28 -08:00
FuzzerUtilLinux.cpp [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
FuzzerUtilPosix.cpp [libFuzzer] Fix stack overflow detection 2021-05-07 08:18:28 -07:00
FuzzerUtilWindows.cpp [fuzzer] Add Windows Visual C++ exception intercept 2020-11-12 13:11:14 -08:00
FuzzerValueBitMap.h [libFuzzer] Separate platform related macros out from FuzzerDefs.h into FuzzerPlatform.h, and adjust includes in other files. 2020-07-14 21:31:56 +00:00
README.txt
build.sh

README.txt

See http://llvm.org/docs/LibFuzzer.html