| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[CompilerRT] Remove ubsan static runtime on Apple This patch removes the static ubsan runtime on Apple devices. The motivation is to reduce the toolchain size. rdar://102061519 Differential Revision: https://reviews.llvm.org/D141550 | 3 年前 | |
Properly generate lists of exported symbols for sanitizer runtimes This change adds a Python script that is invoked for the just-built sanitizer runtime to generate the list of exported symbols passed to the linker. By default, it contains interceptors and sanitizer interface functions, but can be extended with tool-specific lists. llvm-svn: 189356 | 12 年前 | |
[ubsan] Check implicit casts in ObjC for-in statements Check that the implicit cast from id used to construct the element variable in an ObjC for-in statement is valid. This check is included as part of a new objc-cast sanitizer, outside of the main 'undefined' group, as (IIUC) the behavior it's checking for is not technically UB. The check can be extended to cover other kinds of invalid casts in ObjC. Partially addresses: rdar://12903059, rdar://9542496 Differential Revision: https://reviews.llvm.org/D71491 | 5 年前 | |
[compiler-rt] [ubsan] Fix printing of floats in mingw mode In mingw mode on x86, long doubles are 80 bit - while MSVC mode uses long doubles that are equal to regular doubles (on all architectures). In the case of this formatting function, we're calling a MS CRT provided printf function which interprets long doubles as 64 bit. Since the long doubles are equal to regular doubles on all MSVC platforms, just use regular double formatting. For MSVC environments there's no difference, but for mingw environments, this avoids the ambiguity. Differential Revision: https://reviews.llvm.org/D148133 | 3 年前 | |
[NFC][Sanitizer] Pull up GetStackTrace into sanitizer_common We already independently declare GetStackTrace in all (except TSan) sanitizer runtime headers. Lets move it to sanitizer_stacktrace.h to have one canonical way to fill in a BufferedStackFrame. Also enables us to use it in sanitizer_common itself. This patch defines GetStackTrace for TSan and moves the function from ubsan_diag.cc to ubsan_diag_standalone.cc to avoid duplicate symbols for the UBSan-ASan runtime. Other than that this patch just moves the code out of headers and into the correct namespace. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58651 llvm-svn: 355039 | 7 年前 | |
[sanitizer] Simplify __sanitizer::BufferedStackTrace::UnwindImpl implementations Intended to be NFC. D102046 relies on the refactoring for stack boundaries. | 5 年前 | |
[sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks D28596 added SANITIZER_INTERFACE_WEAK_DEF which can guarantee *_default_options are always defined. The weak attributes on the __{asan,lsan,msan,ubsan}_default_options declarations can thus be removed. MaybeCall*DefaultOptions no longer need nullptr checks, so their call sites can just be replaced by __*_default_options. Reviewed By: #sanitizers, vitalybuka Differential Revision: https://reviews.llvm.org/D87175 | 5 年前 | |
[sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks D28596 added SANITIZER_INTERFACE_WEAK_DEF which can guarantee *_default_options are always defined. The weak attributes on the __{asan,lsan,msan,ubsan}_default_options declarations can thus be removed. MaybeCall*DefaultOptions no longer need nullptr checks, so their call sites can just be replaced by __*_default_options. Reviewed By: #sanitizers, vitalybuka Differential Revision: https://reviews.llvm.org/D87175 | 5 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
-fsanitize=function: use type hashes instead of RTTI objects Currently we use RTTI objects to check type compatibility. To support non-unique RTTI objects, commit 5745eccef54ddd3caca278d1d292a88b2281528b added a checkTypeInfoEquality string matching to the runtime. The scheme is inefficient. _Z1fv: .long 846595819 # jmp .long .L__llvm_rtti_proxy-_Z3funv ... main: ... # Load the second word (pointer to the RTTI object) and dereference it. movslq 4(%rsi), %rax movq (%rax,%rsi), %rdx # Is it the desired typeinfo object? leaq _ZTIFvvE(%rip), %rax # If not, call __ubsan_handle_function_type_mismatch_v1, which may recover if checkTypeInfoEquality allows cmpq %rax, %rdx jne .LBB1_2 ... .section .data.rel.ro,"aw",@progbits .p2align 3, 0x0 .L__llvm_rtti_proxy: .quad _ZTIFvvE Let's replace the indirect _ZTI pointer with a type hash similar to -fsanitize=kcfi. _Z1fv: .long 3238382334 .long 2772461324 # type hash main: ... # Load the second word (callee type hash) and check whether it is expected cmpl $-1522505972, -4(%rax) # If not, fail: call __ubsan_handle_function_type_mismatch jne .LBB2_2 The RTTI object derives its name from clang::MangleContext::mangleCXXRTTI, which uses mangleType. mangleTypeName uses mangleType as well. So the type compatibility change is high-fidelity. Since we no longer need RTTI pointers in __ubsan::__ubsan_handle_function_type_mismatch_v1, let's switch it back to version 0, the original signature before e215996a2932ed7c472f4e94dc4345b30fd0c373 (2019). __ubsan::__ubsan_handle_function_type_mismatch_abort is not recoverable, so we can revert some changes from e215996a2932ed7c472f4e94dc4345b30fd0c373. Reviewed By: samitolvanen Differential Revision: https://reviews.llvm.org/D148785 | 3 年前 | |
-fsanitize=function: use type hashes instead of RTTI objects Currently we use RTTI objects to check type compatibility. To support non-unique RTTI objects, commit 5745eccef54ddd3caca278d1d292a88b2281528b added a checkTypeInfoEquality string matching to the runtime. The scheme is inefficient. _Z1fv: .long 846595819 # jmp .long .L__llvm_rtti_proxy-_Z3funv ... main: ... # Load the second word (pointer to the RTTI object) and dereference it. movslq 4(%rsi), %rax movq (%rax,%rsi), %rdx # Is it the desired typeinfo object? leaq _ZTIFvvE(%rip), %rax # If not, call __ubsan_handle_function_type_mismatch_v1, which may recover if checkTypeInfoEquality allows cmpq %rax, %rdx jne .LBB1_2 ... .section .data.rel.ro,"aw",@progbits .p2align 3, 0x0 .L__llvm_rtti_proxy: .quad _ZTIFvvE Let's replace the indirect _ZTI pointer with a type hash similar to -fsanitize=kcfi. _Z1fv: .long 3238382334 .long 2772461324 # type hash main: ... # Load the second word (callee type hash) and check whether it is expected cmpl $-1522505972, -4(%rax) # If not, fail: call __ubsan_handle_function_type_mismatch jne .LBB2_2 The RTTI object derives its name from clang::MangleContext::mangleCXXRTTI, which uses mangleType. mangleTypeName uses mangleType as well. So the type compatibility change is high-fidelity. Since we no longer need RTTI pointers in __ubsan::__ubsan_handle_function_type_mismatch_v1, let's switch it back to version 0, the original signature before e215996a2932ed7c472f4e94dc4345b30fd0c373 (2019). __ubsan::__ubsan_handle_function_type_mismatch_abort is not recoverable, so we can revert some changes from e215996a2932ed7c472f4e94dc4345b30fd0c373. Reviewed By: samitolvanen Differential Revision: https://reviews.llvm.org/D148785 | 3 年前 | |
-fsanitize=function: use type hashes instead of RTTI objects Currently we use RTTI objects to check type compatibility. To support non-unique RTTI objects, commit 5745eccef54ddd3caca278d1d292a88b2281528b added a checkTypeInfoEquality string matching to the runtime. The scheme is inefficient. _Z1fv: .long 846595819 # jmp .long .L__llvm_rtti_proxy-_Z3funv ... main: ... # Load the second word (pointer to the RTTI object) and dereference it. movslq 4(%rsi), %rax movq (%rax,%rsi), %rdx # Is it the desired typeinfo object? leaq _ZTIFvvE(%rip), %rax # If not, call __ubsan_handle_function_type_mismatch_v1, which may recover if checkTypeInfoEquality allows cmpq %rax, %rdx jne .LBB1_2 ... .section .data.rel.ro,"aw",@progbits .p2align 3, 0x0 .L__llvm_rtti_proxy: .quad _ZTIFvvE Let's replace the indirect _ZTI pointer with a type hash similar to -fsanitize=kcfi. _Z1fv: .long 3238382334 .long 2772461324 # type hash main: ... # Load the second word (callee type hash) and check whether it is expected cmpl $-1522505972, -4(%rax) # If not, fail: call __ubsan_handle_function_type_mismatch jne .LBB2_2 The RTTI object derives its name from clang::MangleContext::mangleCXXRTTI, which uses mangleType. mangleTypeName uses mangleType as well. So the type compatibility change is high-fidelity. Since we no longer need RTTI pointers in __ubsan::__ubsan_handle_function_type_mismatch_v1, let's switch it back to version 0, the original signature before e215996a2932ed7c472f4e94dc4345b30fd0c373 (2019). __ubsan::__ubsan_handle_function_type_mismatch_abort is not recoverable, so we can revert some changes from e215996a2932ed7c472f4e94dc4345b30fd0c373. Reviewed By: samitolvanen Differential Revision: https://reviews.llvm.org/D148785 | 3 年前 | |
-fsanitize=function: use type hashes instead of RTTI objects Currently we use RTTI objects to check type compatibility. To support non-unique RTTI objects, commit 5745eccef54ddd3caca278d1d292a88b2281528b added a checkTypeInfoEquality string matching to the runtime. The scheme is inefficient. _Z1fv: .long 846595819 # jmp .long .L__llvm_rtti_proxy-_Z3funv ... main: ... # Load the second word (pointer to the RTTI object) and dereference it. movslq 4(%rsi), %rax movq (%rax,%rsi), %rdx # Is it the desired typeinfo object? leaq _ZTIFvvE(%rip), %rax # If not, call __ubsan_handle_function_type_mismatch_v1, which may recover if checkTypeInfoEquality allows cmpq %rax, %rdx jne .LBB1_2 ... .section .data.rel.ro,"aw",@progbits .p2align 3, 0x0 .L__llvm_rtti_proxy: .quad _ZTIFvvE Let's replace the indirect _ZTI pointer with a type hash similar to -fsanitize=kcfi. _Z1fv: .long 3238382334 .long 2772461324 # type hash main: ... # Load the second word (callee type hash) and check whether it is expected cmpl $-1522505972, -4(%rax) # If not, fail: call __ubsan_handle_function_type_mismatch jne .LBB2_2 The RTTI object derives its name from clang::MangleContext::mangleCXXRTTI, which uses mangleType. mangleTypeName uses mangleType as well. So the type compatibility change is high-fidelity. Since we no longer need RTTI pointers in __ubsan::__ubsan_handle_function_type_mismatch_v1, let's switch it back to version 0, the original signature before e215996a2932ed7c472f4e94dc4345b30fd0c373 (2019). __ubsan::__ubsan_handle_function_type_mismatch_abort is not recoverable, so we can revert some changes from e215996a2932ed7c472f4e94dc4345b30fd0c373. Reviewed By: samitolvanen Differential Revision: https://reviews.llvm.org/D148785 | 3 年前 | |
sanitizer_common: make internal/external headers compatible This is a follow up to 4f3f4d672254 ("sanitizer_common: fix __sanitizer_get_module_and_offset_for_pc signature mismatch") which fixes a similar problem for msan build. I am getting the following error compiling a unit test for code that uses sanitizer_common headers and googletest transitively includes sanitizer interface headers: In file included from third_party/gwp_sanitizers/singlestep_test.cpp:3: In file included from sanitizer_common/sanitizer_common.h:19: sanitizer_interface_internal.h:41:5: error: typedef redefinition with different types ('struct __sanitizer_sandbox_arguments' vs 'struct __sanitizer_sandbox_arguments') } __sanitizer_sandbox_arguments; common_interface_defs.h:39:3: note: previous definition is here } __sanitizer_sandbox_arguments; Reviewed By: melver Differential Revision: https://reviews.llvm.org/D119546 | 4 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
compiler-rt: Rename .cc files in lib/ubsan to .cpp. See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452 | 6 年前 | |
compiler-rt: Rename .cc files in lib/ubsan to .cpp. See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452 | 6 年前 | |
-fsanitize=function: use type hashes instead of RTTI objects Currently we use RTTI objects to check type compatibility. To support non-unique RTTI objects, commit 5745eccef54ddd3caca278d1d292a88b2281528b added a checkTypeInfoEquality string matching to the runtime. The scheme is inefficient. _Z1fv: .long 846595819 # jmp .long .L__llvm_rtti_proxy-_Z3funv ... main: ... # Load the second word (pointer to the RTTI object) and dereference it. movslq 4(%rsi), %rax movq (%rax,%rsi), %rdx # Is it the desired typeinfo object? leaq _ZTIFvvE(%rip), %rax # If not, call __ubsan_handle_function_type_mismatch_v1, which may recover if checkTypeInfoEquality allows cmpq %rax, %rdx jne .LBB1_2 ... .section .data.rel.ro,"aw",@progbits .p2align 3, 0x0 .L__llvm_rtti_proxy: .quad _ZTIFvvE Let's replace the indirect _ZTI pointer with a type hash similar to -fsanitize=kcfi. _Z1fv: .long 3238382334 .long 2772461324 # type hash main: ... # Load the second word (callee type hash) and check whether it is expected cmpl $-1522505972, -4(%rax) # If not, fail: call __ubsan_handle_function_type_mismatch jne .LBB2_2 The RTTI object derives its name from clang::MangleContext::mangleCXXRTTI, which uses mangleType. mangleTypeName uses mangleType as well. So the type compatibility change is high-fidelity. Since we no longer need RTTI pointers in __ubsan::__ubsan_handle_function_type_mismatch_v1, let's switch it back to version 0, the original signature before e215996a2932ed7c472f4e94dc4345b30fd0c373 (2019). __ubsan::__ubsan_handle_function_type_mismatch_abort is not recoverable, so we can revert some changes from e215996a2932ed7c472f4e94dc4345b30fd0c373. Reviewed By: samitolvanen Differential Revision: https://reviews.llvm.org/D148785 | 3 年前 | |
[sanitizer] Remove max_len parameter from InternalScopedString InternalScopedString uses InternalMmapVector internally so it can be resized dynamically as needed. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D98751 | 5 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
[asan] Remove Asan, Ubsan support of RTEMS and Myriad Differential Revision: https://reviews.llvm.org/D104279 | 4 年前 | |
sanitizer_common: initialize sanitizer runtimes lazily from signal interceptors Currently if a program calls sigaction very early (before non-lazy sanitizer initialization, in particular if .preinit_array initialization is not enabled), then sigaction will wrongly fail since the interceptor is not initialized yet. In all other interceptors we do lazy runtime initialization for this reason, but we don't do it in the signal interceptors. Do lazy runtime initialization in signal interceptors as well. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D155188 | 2 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
Remove a few straggler ".cc"s in compiler-rt/lib llvm-svn: 367589 | 6 年前 | |
Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO This follows up after b7692bc3e9ad2691fc07261904b88fb15f30696b "[UBSan] Fix isDerivedFromAtOffset on iOS ARM64" fixed the RTTI comparison in isDerivedFromAtOffset on just one platform and then a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692 "Always compare C++ typeinfo (based on libstdc++ implementation)" extended that fix to more platforms. But there is another RTTI comparison for -fsanitize=function generated in clang's CodeGenFunction::EmitCall as just a pointer comparison. For SANITIZER_NON_UNIQUE_TYPEINFO platforms this needs to be extended to also do string comparison. For that, __ubsan_handle_function_type_mismatch[_abort] takes the two std::type_info pointers as additional parameters now, checks them internally for potential equivalence, and returns without reporting failure if they turn out to be equivalent after all. (NORETURN needed to be dropped from the _abort variant for that.) Also these functions depend on ABI-specific RTTI now, so needed to be moved from plain UBSAN_SOURCES (ubsan_handlers.h/cc) to UBSAN_CXXABI_SOURCES (ubsan_handlers_cxx.h/cc), but as -fsanitize=function is only supported in C++ mode that's not a problem. Differential Revision: https://reviews.llvm.org/D60760 llvm-svn: 359759 | 7 年前 | |
[UBSan] Implementation NonUniqueARMRTTIBit __type_name has higher bits set on arm64 Differential Revision: https://reviews.llvm.org/D137518 | 3 年前 | |
[compiler-rt] [ubsan] Use the itanium type info lookup for mingw targets Differential Revision: https://reviews.llvm.org/D90571 | 5 年前 | |
[Sanitizer][Darwin][NFC] Small SANITIZER_APPLE cleanup We introduced SANITIZER_APPLE here: https://reviews.llvm.org/D126263 | 3 年前 | |
[ubsan] Check implicit casts in ObjC for-in statements Check that the implicit cast from id used to construct the element variable in an ObjC for-in statement is valid. This check is included as part of a new objc-cast sanitizer, outside of the main 'undefined' group, as (IIUC) the behavior it's checking for is not technically UB. The check can be extended to cover other kinds of invalid casts in ObjC. Partially addresses: rdar://12903059, rdar://9542496 Differential Revision: https://reviews.llvm.org/D71491 | 5 年前 | |
compiler-rt: Rename .cc files in lib/ubsan to .cpp. See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452 | 6 年前 | |
compiler-rt: Rename .cc files in lib/ubsan to .cpp. See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452 | 6 年前 | |
compiler-rt: Rename .cc files in lib/ubsan to .cpp. See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452 | 6 年前 | |
Enable weak hooks on darwin Summary: By default, darwin requires a definition for weak interface functions at link time. Adding the '-U' link flag with each weak function allows these weak interface functions to be used without definitions, which mirrors behavior on linux and windows. Reviewers: compnerd, eugenis Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28203 llvm-svn: 291417 | 9 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 12 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 7 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 7 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 7 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 7 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 7 年前 | ||
| 6 年前 | ||
| 7 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 9 年前 |