hanchenye-llvm-project/compiler-rt/lib/fuzzer
Matt Morehouse ffb1132e52 [libFuzzer] Add support for Fuchsia OS.
Summary:
This patch adds the initial support for Fuchsia.

- LIBFUZZER_FUCHSIA is added as an OS type in FuzzerDefs.h
- Fuchsia is, by design, not POSIX compliant. However, it does use ELF and
  supports common POSIX I/O functions. Thus, FuzzerExtFunctions.h and
  FuzzerIO.h are implemented by extending the header guards in
  FuzzerExtFunctionsWeak.cpp and FuzzerIOPosix.cpp to include
  LIBFUZZER_FUCHSIA.
- The platform-specific portions of FuzzerUtil.h are implemented by
  FuzzerUtilFuchsia.cpp, which makes use of exception ports, syscalls, and
  the launchpad library.
- The experimental equivalence server is not currently supported, so
  FuzzerShmem.h is implemented by stub methods in FuzzerShmemFuchsia.cpp.
  Any future implementation will likely involve VMOs.

Tested with ASAN/SanCov on Fuchsia/x86-64 with the canonical toy fuzzer.

Patch By: aarongreen

Reviewers: kcc, morehouse, flowerhack, phosek

Reviewed By: kcc, phosek, Eugene.Zelenko

Subscribers: srhines, mgorny, Eugene.Zelenko

Differential Revision: https://reviews.llvm.org/D40974

llvm-svn: 320210
2017-12-08 22:54:44 +00:00
..
afl Add preliminary NetBSD support in libfuzzer 2017-08-30 22:44:11 +00:00
scripts [fuzzer] Script to detect unbalanced allocation in -trace_malloc output 2017-11-01 20:27:06 +00:00
standalone
tests [libFuzzer] Decrease stack usage in unit tests 2017-12-06 23:35:02 +00:00
CMakeLists.txt [libFuzzer] Add support for Fuchsia OS. 2017-12-08 22:54:44 +00:00
FuzzerClangCounters.cpp [libFuzzer] apply changes lost during the migration to compiler-rt 2017-08-22 01:28:32 +00:00
FuzzerCommand.h [libFuzzer] Make redirects happen in proper sequence. 2017-12-05 17:13:17 +00:00
FuzzerCorpus.h [libFuzzer] tweam use_feature_frequency to be less aggressive; run a dummy input before the seed corpus 2017-10-13 01:12:23 +00:00
FuzzerCrossOver.cpp
FuzzerDefs.h [libFuzzer] Add support for Fuchsia OS. 2017-12-08 22:54:44 +00:00
FuzzerDictionary.h [libFuzzer] Use custom allocators for STL containers in libFuzzer. 2017-08-27 23:20:09 +00:00
FuzzerDriver.cpp [libFuzzer] fix a minor regression in printing 2017-12-06 22:12:24 +00:00
FuzzerExtFunctions.def [libFuzzer] Periodically purge allocator's quarantine to prolong fuzzing sessions. 2017-10-23 22:04:30 +00:00
FuzzerExtFunctions.h
FuzzerExtFunctionsDlsym.cpp
FuzzerExtFunctionsDlsymWin.cpp
FuzzerExtFunctionsWeak.cpp [libFuzzer] Add support for Fuchsia OS. 2017-12-08 22:54:44 +00:00
FuzzerExtFunctionsWeakAlias.cpp
FuzzerExtraCounters.cpp Add preliminary NetBSD support in libfuzzer 2017-08-30 22:44:11 +00:00
FuzzerFlags.def [libFuzzer] add a flag -malloc_limit_mb 2017-12-01 22:12:04 +00:00
FuzzerIO.cpp [libFuzzer] factor out some code into GetSizedFilesFromDir; NFC 2017-09-12 21:58:07 +00:00
FuzzerIO.h [libFuzzer] factor out some code into GetSizedFilesFromDir; NFC 2017-09-12 21:58:07 +00:00
FuzzerIOPosix.cpp [libFuzzer] Add support for Fuchsia OS. 2017-12-08 22:54:44 +00:00
FuzzerIOWindows.cpp [libFuzzer] Use custom allocators for STL containers in libFuzzer. 2017-08-27 23:20:09 +00:00
FuzzerInterface.h
FuzzerInternal.h [libFuzzer] add an experimental search heuristic flag -reduce_depth 2017-12-01 19:18:38 +00:00
FuzzerLoop.cpp [libFuzzer] honor -use_counters, sligntly change the meaning of -experimental_len_control, call UpdateFeatureFrequency only if instructed by the flag 2017-12-08 22:21:42 +00:00
FuzzerMain.cpp
FuzzerMerge.cpp [libFuzzer] Encapsulate commands in a class. 2017-12-04 19:25:59 +00:00
FuzzerMerge.h [libFuzzer] Use custom allocators for STL containers in libFuzzer. 2017-08-27 23:20:09 +00:00
FuzzerMutate.cpp [libFuzzer] Use custom allocators for STL containers in libFuzzer. 2017-08-27 23:20:09 +00:00
FuzzerMutate.h [libFuzzer] Use custom allocators for STL containers in libFuzzer. 2017-08-27 23:20:09 +00:00
FuzzerOptions.h [libFuzzer] honor -use_counters, sligntly change the meaning of -experimental_len_control, call UpdateFeatureFrequency only if instructed by the flag 2017-12-08 22:21:42 +00:00
FuzzerRandom.h
FuzzerSHA1.cpp
FuzzerSHA1.h
FuzzerShmem.h
FuzzerShmemFuchsia.cpp [libFuzzer] Add support for Fuchsia OS. 2017-12-08 22:54:44 +00:00
FuzzerShmemPosix.cpp
FuzzerShmemWindows.cpp
FuzzerTracePC.cpp [libFuzzer] print a better warning if we hit the ld bug 2017-10-14 00:07:11 +00:00
FuzzerTracePC.h [libFuzzer] honor -use_counters, sligntly change the meaning of -experimental_len_control, call UpdateFeatureFrequency only if instructed by the flag 2017-12-08 22:21:42 +00:00
FuzzerUtil.cpp [fuzzer] Initialize PcDescr buffer before calling __sanitizer_symbolize_pc 2017-11-17 00:46:59 +00:00
FuzzerUtil.h [libFuzzer] Encapsulate commands in a class. 2017-12-04 19:25:59 +00:00
FuzzerUtilDarwin.cpp [libFuzzer] Encapsulate commands in a class. 2017-12-04 19:25:59 +00:00
FuzzerUtilFuchsia.cpp [libFuzzer] Add support for Fuchsia OS. 2017-12-08 22:54:44 +00:00
FuzzerUtilLinux.cpp [libFuzzer] Encapsulate commands in a class. 2017-12-04 19:25:59 +00:00
FuzzerUtilPosix.cpp [libFuzzer] handle SIGUSR1/SIGUSR2 and try to exit grafully on these signals 2017-11-09 20:30:19 +00:00
FuzzerUtilWindows.cpp [libFuzzer] Encapsulate commands in a class. 2017-12-04 19:25:59 +00:00
FuzzerValueBitMap.h
README.txt [libFuzzer] better README.txt 2017-08-22 01:15:40 +00:00
build.sh

README.txt

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