summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/ubsan
Commit message (Collapse)AuthorAgeFilesLines
...
* [UBSan] Fix typo in CMake conditional that checked if the architectureDan Liew2018-09-191-1/+1
| | | | | | | | | | | | | | of a darwin platform was in the list of `UBSAN_SUPPORTED_ARCH`. This is a follow up to r341306. The typo meant that if an architecture was a prefix to another architecture in the list (e.g. `armv7` is a prefix of `armv7k`) then this would trigger a match which is not the intended behaviour. rdar://problem/41126835 llvm-svn: 342553
* [UBSan] Partially fix `test/ubsan/TestCases/Misc/log-path_test.cc` so that ↵Dan Liew2018-09-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it can run on devices. Summary: In order for this test to work the log file needs to be removed from both from the host and device. To fix this the `rm` `RUN` lines have been replaced with `RUN: rm` followed by `RUN: %device_rm`. Initially I tried having it so that `RUN: %run rm` implicitly runs `rm` on the host as well so that only one `RUN` line is needed. This simplified writing the test however that had two large drawbacks. * It's potentially very confusing (e.g. for use of the device scripts outside of the lit tests) if asking for `rm` to run on device also causes files on the host to be deleted. * This doesn't work well with the glob patterns used in the test. The host shell expands the `%t.log.*` glob pattern and not on the device so we could easily miss deleting old log files from previous test runs if the corresponding file doesn't exist on the host. So instead deletion of files on the device and host are explicitly separate commands. The command to delete files from a device is provided by a new substitution `%device_rm` as suggested by Filipe Cabecinhas. The semantics of `%device_rm` are that: * It provides a way remove files from a target device when the host is not the same as the target. In the case that the host and target are the same it is a no-op. * It interprets shell glob patterns in the context of the device file system instead of the host file system. This solves the globbing problem provided the argument is quoted so that lit's underlying shell doesn't try to expand the glob pattern. * It supports the `-r` and `-f` flags of the `rm` command, with the same semantics. Right now an implementation of `%device_rm` is provided only for ios devices. For all other devices a lit warning is emitted and the `%device_rm` is treated as a no-op. This done to avoid changing the behaviour for other device types but leaves room for others to implement `%device_rm`. The ios device implementation uses the `%run` wrapper to do the work of removing files on a device. The `iossim_run.py` script has been fixed so that it just runs `rm` on the host operating system because the device and host file system are the same. rdar://problem/41126835 Reviewers: vsk, kubamracek, george.karpenkov, eugenis Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51648 llvm-svn: 342391
* [UBSan] Add CMake and lit support for configuring and running UBSanDan Liew2018-09-033-0/+69
| | | | | | | | | | | | | tests for ios, watchos, tvos, and their simulator counterparts. This commit does not make the tests actually pass. This will be handled in later commits. rdar://problem/41126835 Differential Revision: https://reviews.llvm.org/D51270 llvm-svn: 341306
* [UBSan] Add missing `%run` prefixes to Pointer tests.Dan Liew2018-09-032-4/+4
| | | | | | | | | | | | Summary: rdar://problem/41126835 Reviewers: vsk, kubamracek Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51271 llvm-svn: 341298
* [NFC] Some small test updates for Implicit Conversion sanitizer.Roman Lebedev2018-08-172-5/+81
| | | | | | Split off from D50251. llvm-svn: 339996
* [CMake] Use normalized Windows target triplesPetr Hosek2018-08-0910-10/+10
| | | | | | | | | | | Changes the default Windows target triple returned by GetHostTriple.cmake from the old environment names (which we wanted to move away from) to newer, normalized ones. This also requires updating all tests to use the new systems names in constraints. Differential Revision: https://reviews.llvm.org/D47381 llvm-svn: 339307
* [NFC] Rename test/ubsan/TestCases/{ImplicitCast => ImplicitConversion}Roman Lebedev2018-07-303-0/+0
| | | | | | | | Just to be consistent with the rest. I should have done that in the commit itself, but the filepaths is one thing i forgot to verify :S llvm-svn: 338307
* [compiler-rt] integer-truncation-blacklist.c: XFAIL on android/iosRoman Lebedev2018-07-301-0/+5
| | | | | | | | | | | | | | | The Builder sanitizer-x86_64-linux-android is failing starting with rL338287 / D48959. It runs the tests via android_compile.py, so i'm not sure this is actually *this* issue: https://code.google.com/p/address-sanitizer/issues/detail?id=316 but this seems oddly similar to the other XFAIL'ed cases... Right now that seems to be the only failing builder, so i *think* it makes sense to try to just blacklist it for now. llvm-svn: 338296
* [compiler-rt][ubsan] Implicit Conversion Sanitizer - integer truncation - ↵Roman Lebedev2018-07-303-0/+91
| | | | | | | | | | | | | | | | | | | | | | compiler-rt part Summary: This is a compiler-rt part. The clang part is D48958. See [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], https://github.com/google/sanitizers/issues/940. Reviewers: #sanitizers, samsonov, vsk, rsmith, pcc, eugenis, kcc, filcab Reviewed By: #sanitizers, vsk, filcab Subscribers: llvm-commits, eugenis, filcab, kubamracek, dberris, #sanitizers, regehr Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D48959 llvm-svn: 338287
* [test] Use printf instead of C++ iostream, NFC.Jonas Hahnfeld2018-07-261-4/+4
| | | | | | | | | | | This test fails with libc++ when built with MemorySanitizer. This is because we link to an uninstrumented version of the library so msan detects a nested error when calling std::cout << "...". This can be easily avoided by using good old printf. Differential Revision: https://reviews.llvm.org/D49867 llvm-svn: 338053
* [UBSan] Followup for silence_unsigned_overflow flag to handle negate overflows.Max Moroz2018-07-131-1/+3
| | | | | | | | | | | | | | | | | | | | Summary: That flag has been introduced in https://reviews.llvm.org/D48660 for suppressing UIO error messages in an efficient way. The main motivation is to be able to use UIO checks in builds used for fuzzing as it might provide an interesting signal to a fuzzing engine such as libFuzzer. See https://github.com/google/oss-fuzz/issues/910 for more information. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49324 llvm-svn: 337068
* [compiler-rt] Get rid of "%T" expansionsFilipe Cabecinhas2018-07-101-7/+7
| | | | | | | | | | | | | | | | | | | Summary: Original patch by Kuba Mracek The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in compiler-rt. Differential Revision: https://reviews.llvm.org/D48618 llvm-svn: 336661
* [UBsan] Enable subset of unit tests for OpenBSDDavid Carlier2018-06-308-1/+15
| | | | | | | | | | Reviewers: kubamracek, krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D48805 llvm-svn: 336053
* [UBSan] Add silence_unsigned_overflow flag.Matt Morehouse2018-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | Summary: Setting UBSAN_OPTIONS=silence_unsigned_overflow=1 will silence all UIO reports. This feature, combined with -fsanitize-recover=unsigned-integer-overflow, is useful for providing fuzzing signal without the excessive log output. Helps with https://github.com/google/oss-fuzz/issues/910. Reviewers: kcc, vsk Reviewed By: vsk Subscribers: vsk, kubamracek, Dor1s, llvm-commits Differential Revision: https://reviews.llvm.org/D48660 llvm-svn: 335762
* [ubsan] Mark a test case as unsupported on WindowsVedant Kumar2018-06-251-2/+7
| | | | | | | | | __ubsan_on_report isn't defined as weak, and redefining it in a test is not supported on Windows. See the error message here: https://reviews.llvm.org/D48446 llvm-svn: 335523
* [ubsan] Add support for reporting diagnostics to a monitor processVedant Kumar2018-06-221-0/+37
| | | | | | | | | | | | | | | | | | Add support to the ubsan runtime for reporting diagnostics to a monitor process (e.g a debugger). The Xcode IDE uses this by setting a breakpoint on __ubsan_on_report and collecting diagnostic information via __ubsan_get_current_report_data, which it then surfaces to users in the editor UI. Testing for this functionality already exists in upstream lldb, here: lldb/packages/Python/lldbsuite/test/functionalities/ubsan Apart from that, this is `ninja check-{a,ub}san` clean. Differential Revision: https://reviews.llvm.org/D48446 llvm-svn: 335371
* [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)Kamil Rytarowski2018-01-173-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch (on top of the previous two (https://reviews.llvm.org/D40898 and https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris sanitizer port. It contains the following sets of changes: * For the time being, the port is for 32-bit x86 only, so reject the various tests on x86_64. * When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares _setjmp and _longjmp inside namespace std. * MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a no-op compat define, Solaris does not. * test/asan/TestCases/Posix/coverage.cc was initially failing like this: /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument Further digging revealed that the rm was trying to remove the running test's working directory which failed as observed. cd'ing out of the dir before let the test pass. * Two tests needed a declaration of alloca. I've now copied the existing code from test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and maintainable to have a common testsuite header where such code is collected. * Similarly, Solaris' printf %p format doesn't include the leading 0x. * In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__ (predefined by clang for no apparent reason) to avoid conflicting declarations for memalign. * test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and friends as predefined by clang and gcc? Patch by Rainer Orth. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40900 llvm-svn: 322635
* o -fsanitize=function warning when calling noexcept function through ↵Stephan Bergmann2018-01-051-1/+41
| | | | | | | | | | | | | | | | | | | | | | non-noexcept pointer in C++17 As discussed in the mail thread <https://groups.google.com/a/isocpp.org/forum/ #!topic/std-discussion/T64_dW3WKUk> "Calling noexcept function throug non- noexcept pointer is undefined behavior?", such a call should not be UB. However, Clang currently warns about it. This change removes exception specifications from the function types recorded for -fsanitize=function, both in the functions themselves and at the call sites. That means that calling a non-noexcept function through a noexcept pointer will also not be flagged as UB. In the review of this change, that was deemed acceptable, at least for now. (See the "TODO" in compiler-rt test/ubsan/TestCases/TypeCheck/Function/function.cpp.) This is the compiler-rt part of a patch covering both cfe and compiler-rt. Differential Revision: https://reviews.llvm.org/D40720 llvm-svn: 321860
* -fsanitize=vptr warnings on bad static types in dynamic_cast and typeidStephan Bergmann2017-12-281-24/+91
| | | | | | | | | | | | | | | | ...when such an operation is done on an object during con-/destruction. (This adds a test case to compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp that, unlike the existing test cases there, wants to detect multiple UBSan warnings in one go. Therefore, that file had to be changed from globally using -fno-sanitize-recover to individually using halt_on_error only where appropriate.) This is the compiler-rt part of a patch covering both cfe and compiler-rt. Differential Revision: https://reviews.llvm.org/D40295 llvm-svn: 321518
* [ubsan] Diagnose noreturn functions which return (compiler-rt)Vedant Kumar2017-12-212-3/+23
| | | | | | | | This is paired with the clang change: https://reviews.llvm.org/D40698 Differential Revision: https://reviews.llvm.org/D40700 llvm-svn: 321232
* Revert r320977 "No -fsanitize=function warning when calling noexcept ↵Stephan Bergmann2017-12-181-39/+1
| | | | | | | | | | | | | function through non-noexcept pointer in C++17" At least <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/ builds/6013/steps/annotate/logs/stdio> complains about __ubsan::__ubsan_handle_function_type_mismatch_abort (compiler-rt lib/ubsan/ubsan_handlers.cc) returning now despite being declared 'noreturn', so looks like a different approach is needed for the function_type_mismatch check to be called also in cases that may ultimately succeed. llvm-svn: 320981
* No -fsanitize=function warning when calling noexcept function through ↵Stephan Bergmann2017-12-181-1/+39
| | | | | | | | | | | | | | | | | | | | | | | non-noexcept pointer in C++17 As discussed in the mail thread <https://groups.google.com/a/isocpp.org/forum/ #!topic/std-discussion/T64_dW3WKUk> "Calling noexcept function throug non- noexcept pointer is undefined behavior?", such a call should not be UB. However, Clang currently warns about it. There is no cheap check whether two function type_infos only differ in noexcept,so pass those two type_infos as additional data to the function_type_mismatch handler (with the optimization of passing a null "static callee type" info when that is already noexcept, so the additional check can be avoided anyway). For the Itanium ABI (which appears to be the only one that happens to be used on platforms that support -fsanitize=function, and which appears to only record noexcept information for pointer-to-function type_infos, not for function type_infos themselves), we then need to check the mangled names for occurrence of "Do" representing "noexcept". This is the compiler-rt part of a patch covering both cfe and compiler-rt. Differential Revision: https://reviews.llvm.org/D40720 llvm-svn: 320977
* [ubsan] Test for pass_object_size bounds checksVedant Kumar2017-12-081-0/+16
| | | | llvm-svn: 320129
* [ubsan] Re-commit: lit changes for lld testing, future lto testing.Roman Lebedev2017-12-013-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. The original attempt, r319525 was reverted in r319526 due to the failures in compiler-rt standalone builds. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 llvm-svn: 319575
* Revert "[ubsan] lit changes for lld testing, future lto testing."Roman Lebedev2017-12-013-33/+13
| | | | | | | | | | | | | | | | | | | | This reverts commit r319525. This change has introduced a problem with the Lit tests build for compiler-rt using Gold: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/6047/steps/test%20standalone%20compiler-rt/logs/stdio llvm-lit: /b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file '/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg', traceback: Traceback (most recent call last): File "/b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path exec(compile(data, path, 'exec'), cfg_globals, None) File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 37, in <module> if root.host_os not in ['Linux'] or not is_gold_linker_available(): File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 27, in is_gold_linker_available stderr = subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory llvm-svn: 319529
* [ubsan] lit changes for lld testing, future lto testing.Roman Lebedev2017-12-013-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 llvm-svn: 319525
* sanitizer_common: Try looking up symbols with RTLD_DEFAULT if RTLD_NEXT does ↵Peter Collingbourne2017-11-103-0/+25
| | | | | | | | | | | | | | not work. If the lookup using RTLD_NEXT failed, the sanitizer runtime library is later in the library search order than the DSO that we are trying to intercept, which means that we cannot intercept this function. We still want the address of the real definition, though, so look it up using RTLD_DEFAULT. Differential Revision: https://reviews.llvm.org/D39779 llvm-svn: 317930
* Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov2017-10-101-5/+0
| | | | | | | This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. llvm-svn: 315389
* XFAIL ubsan/TestCases/TypeCheck/Function/function.cpp on WindowsHans Wennborg2017-10-101-0/+1
| | | | | | I think it got accidentally enabled in r315105 or thereabouts. llvm-svn: 315374
* [ubsan] Fix Asan internal alloc corruption in PR33221 test.Evgeniy Stepanov2017-10-091-1/+1
| | | | | | MAP_FIXED discards the existing mapping at the given address. llvm-svn: 315247
* [ubsan] Disable one test on Android.Evgeniy Stepanov2017-10-091-0/+2
| | | | llvm-svn: 315220
* cmake: Fix one more usage of append()Vedant Kumar2017-10-071-1/+1
| | | | | | | | | append() isn't available with some cmake versions, so I need to use a different construct. I missed this case in r315144. http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/39355 llvm-svn: 315157
* [ubsan] Add a static runtime on DarwinVedant Kumar2017-10-073-0/+14
| | | | | | | | As a follow-up to r315142, this makes it possible to use ubsan with a static runtime on Darwin. I've also added a new StandaloneStatic testing configuration so the new setup can be tested. llvm-svn: 315143
* Factor out default_(a|ub)sanitizer_opts in lit.Evgeniy Stepanov2017-10-061-8/+1
| | | | | | | | | | Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D38644 llvm-svn: 315106
* [sanitizer] Test ubsan and cfi on android.Evgeniy Stepanov2017-10-064-3/+7
| | | | | | | | | | | | | | | Summary: Enable check-cfi and check-ubsan on Android. Check-ubsan includes standalone and ubsan+asan, but not tsan or msan. Cross-dso cfi tests are disabled for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38608 llvm-svn: 315105
* [sanitizer] Move %ld_flags_rpath_exe to common and use it in more tests.Evgeniy Stepanov2017-10-051-2/+2
| | | | | | | | | | Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38527 llvm-svn: 315010
* ubsan: Unbreak ubsan_cxx runtime library on Windows.Peter Collingbourne2017-09-155-0/+5
| | | | | | | | | | | | | | | | This was originally broken by r258744 which introduced a weak reference from ubsan to ubsan_cxx. This reference does not work directly on Windows because COFF has no direct concept of weak symbols. The fix is to use /alternatename to create a weak external reference to ubsan_cxx. Also fix the definition (and the name, so that we drop cached values) of the cmake flag that controls whether to build ubsan_cxx. Now the user-controllable flag is always on, and we turn it off internally depending on whether we support building it. Differential Revision: https://reviews.llvm.org/D37882 llvm-svn: 313391
* [ubsan] Enable -fsanitize=function test on DarwinVedant Kumar2017-09-131-6/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D37598 llvm-svn: 313097
* Enable ubsan on NetBSDKamil Rytarowski2017-08-082-5/+11
| | | | | | | | | | | | | | | | | | | Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, filcab, fjricci Reviewed By: fjricci Subscribers: srhines, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36483 llvm-svn: 310412
* [ubsan] Test -fsanitize=vptr without -fsanitize=nullVedant Kumar2017-08-022-2/+2
| | | | | | | | This reverts commit r309042, thereby adding a test for -fsanitize=vptr functionality without -fsanitize=null. It also removes -fsanitize=null from another -fsanitize=vptr test. llvm-svn: 309847
* [ubsan] Diagnose invalid uses of builtins (compiler-rt)Vedant Kumar2017-07-292-0/+37
| | | | | | Differential Revision: https://reviews.llvm.org/D34591 llvm-svn: 309461
* [ubsan] Update a test missed in r309008, NFCVedant Kumar2017-07-251-1/+1
| | | | llvm-svn: 309042
* [ubsan] -fsanitize=vptr now requires -fsanitize=null, update testsVedant Kumar2017-07-254-10/+19
| | | | | See: https://bugs.llvm.org/show_bug.cgi?id=33881 llvm-svn: 309008
* [ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" ↵Vedant Kumar2017-07-131-4/+11
| | | | | | | | (compiler-rt) Compiler-rt changes associated with: D34121 llvm-svn: 307956
* [ubsan] Improve diagnostics for return value checks (compiler-rt)Vedant Kumar2017-06-232-6/+33
| | | | | | Differential Revision: https://reviews.llvm.org/D34298 llvm-svn: 306164
* [ubsan] Fix a faulty memory accessibility checkVedant Kumar2017-06-153-1/+60
| | | | | | | | | | | | | The dynamic type check needs to inspect vtables, but could crash if it encounters a vtable pointer to inaccessible memory. In the first attempt to fix the issue (r304437), we performed a memory accessibility check on the wrong range of memory. This should *really* fix the problem. Patch by Max Moroz! Differential Revision: https://reviews.llvm.org/D34215 llvm-svn: 305489
* [ubsan] Detect invalid unsigned pointer index expression (compiler-rt)Vedant Kumar2017-06-121-0/+13
| | | | | | | | Compiler-rt part of: https://reviews.llvm.org/D33910 Differential Revision: https://reviews.llvm.org/D33911 llvm-svn: 305217
* [ubsan] Runtime support for pointer overflow checkingVedant Kumar2017-06-011-0/+19
| | | | | | | | Patch by John Regehr and Will Dietz! Differential Revision: https://reviews.llvm.org/D20323 llvm-svn: 304461
* Tighten up test to address bot failure. NFC.Vedant Kumar2017-06-011-3/+7
| | | | | | http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/32035 llvm-svn: 304440
* Bug 33221 [UBSAN] segfault with -fsanitize=undefinedVedant Kumar2017-06-011-0/+24
| | | | | | | | | | | | | | | There is can be a situation when vptr is not initializing by constructor of the object, and has a junk data which should be properly checked, because c++ standard says: "if default constructor is not specified 16 (7.3) no initialization is performed." Patch by Denis Khalikov! Differential Revision: https://reviews.llvm.org/D33712 llvm-svn: 304437
OpenPOWER on IntegriCloud