llvm-project/clang/lib
Dokyung Song 831ae45e3d Recommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked."
Summary: libFuzzer intercepts certain library functions such as memcmp/strcmp by defining weak hooks. Weak hooks, however, are called only when other runtimes such as ASan is linked. This patch defines libFuzzer's own interceptors, which is linked into the libFuzzer executable when other runtimes are not linked, i.e., when -fsanitize=fuzzer is given, but not others.

The patch once landed but was reverted in 8ef9e2bf35 due to an assertion failure caused by calling an intercepted function, strncmp, while initializing the interceptors in fuzzerInit(). This issue is now fixed by calling libFuzzer's own implementation of library functions (i.e., internal_*) when the fuzzer has not been initialized yet, instead of recursively calling fuzzerInit() again.

Reviewers: kcc, morehouse, hctim

Subscribers: #sanitizers, krytarowski, mgorny, cfe-commits

Tags: #clang, #sanitizers

Differential Revision: https://reviews.llvm.org/D83494
2020-07-23 15:59:07 +00:00
..
ARCMigrate With MSVC, file needs to be compiled with /BIGOBJ 2020-07-17 09:43:06 -07:00
AST For PR46800, implement the GCC __builtin_complex builtin. 2020-07-22 13:43:10 -07:00
ASTMatchers Make helpers static. NFC. 2020-07-17 13:49:11 +02:00
Analysis [Analyzer] Report every bug if only uniqueing location differs. 2020-07-15 12:19:25 +02:00
Basic [OpenMP] Implement TR8 `present` map type modifier in Clang (1/2) 2020-07-22 10:15:32 -04:00
CodeGen For PR46800, implement the GCC __builtin_complex builtin. 2020-07-22 13:43:10 -07:00
CrossTU [analyzer] Add CTUImportCppThreshold for C++ files 2020-07-09 15:36:33 +02:00
DirectoryWatcher [DirectoryWatcher] Do not use FSEvents on non-macOS platforms 2020-04-23 10:22:28 -07:00
Driver Recommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked." 2020-07-23 15:59:07 +00:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [clang-format] Add BitFieldColonSpacing option 2020-07-20 20:55:51 +02:00
Frontend accept 'clang++ -c a.pch -o a.o' to create PCH's object file 2020-07-22 10:21:23 +02:00
FrontendTool [NFC] Refactor Registry loops to range for 2020-06-19 00:40:10 +01:00
Headers Fix pow and ldexp in HIP header 2020-07-21 17:39:46 -04:00
Index [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
Lex Revert abd45154b "[Coverage] Add comment to skipped regions" 2020-07-22 17:09:20 +02:00
Parse [OpenMP] Implement TR8 `present` map type modifier in Clang (1/2) 2020-07-22 10:15:32 -04:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema For PR46800, implement the GCC __builtin_complex builtin. 2020-07-22 13:43:10 -07:00
Serialization Merge some of the PCH object support with modular codegen 2020-07-22 12:46:12 -07:00
StaticAnalyzer [Analyzer][StreamChecker] Use BugType::SuppressOnSink at resource leak report. 2020-07-23 11:53:25 +02:00
Testing Fix MSVC "not all control paths return a value" warning. NFC. 2020-06-05 10:45:59 +01:00
Tooling [libTooling] In Clang Transformer, change `Metadata` field to deferred evaluation. 2020-07-21 18:05:49 +00:00
CMakeLists.txt Move unittest helpers to a shared location 2020-05-29 16:47:33 +02:00