Skip to content
  1. Jan 23, 2018
    • Kamil Rytarowski's avatar
      Add a new interceptor: paccept(2) · 70552c6f
      Kamil Rytarowski authored
      Summary:
      paccept(2) is a NetBSD-specific variation of accept(2).
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka, eugenis
      
      Reviewed By: vitalybuka
      
      Subscribers: llvm-commits, kubamracek, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42052
      
      llvm-svn: 323273
      70552c6f
    • Francis Ricci's avatar
      [ubsan] Add preinit initializer for ubsan · 564f845b
      Francis Ricci authored
      Summary:
      Now that ubsan does function interception (for signals), we
      need to ensure that ubsan is initialized before any library
      constructors are called. Otherwise, if a constructor calls
      sigaction, ubsan will intercept in an unitialized state, which
      will cause a crash.
      
      This patch is a partial revert of r317757, which removed
      preinit arrays for ubsan.
      
      Reviewers: vitalybuka, eugenis, pcc
      
      Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42389
      
      llvm-svn: 323249
      564f845b
    • Bill Seurer's avatar
      [PowerPC][asan] Fix asan tests to handle changed memory layouts · e76f2171
      Bill Seurer authored
      In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
      for powerpc64 changed causing the address sanitizer to not work properly. This
      patch fixes up a test case that was found to fail on some newer Fedora
      releases that use different address ranges.
      
      ref: https://reviews.llvm.org/D40907
      llvm-svn: 323217
      e76f2171
    • Alex Shlyapnikov's avatar
      Small fixes for detect_invalid_pointer_pairs. · ac8217de
      Alex Shlyapnikov authored
      Summary:
      One test-case uses a wrong operation (should be subtraction).
      Second test-case should declare a global variables before a tested one
      in order to guarantee we will find a red-zone.
      
      Reviewers: kcc, jakubjelinek, alekseyshl
      
      Reviewed By: alekseyshl
      
      Subscribers: kubamracek
      
      Differential Revision: https://reviews.llvm.org/D41481
      
      llvm-svn: 323162
      ac8217de
  2. Jan 22, 2018
  3. Jan 21, 2018
  4. Jan 20, 2018
  5. Jan 19, 2018
  6. Jan 18, 2018
    • Kostya Kortchinsky's avatar
      [scudo] Use -fsanitize=scudo rather than --whole-archive in tests · ab0d8874
      Kostya Kortchinsky authored
      Summary:
      Tests were being run by whole-linking the static library with our test binaries.
      But since `-fsanitize=scudo` landed with rL317337, we might as well change how
      the tests are compiled to use it.
      
      The only difference will be on Android, where the clang flag links in the
      dynamic library instead, but the bots are already pushing
      `libclang_rt.*-android.so` to the device there is no additional change needed.
      
      Tested locally, including with a standalone build, and an Android one on a O
      device, and it all passes.
      
      Reviewers: alekseyshl
      
      Reviewed By: alekseyshl
      
      Subscribers: #sanitizers, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42243
      
      llvm-svn: 322882
      ab0d8874
    • Kamil Rytarowski's avatar
      Enable sanitizer_common tests on NetBSD · ba91a689
      Kamil Rytarowski authored
      Summary:
      NetBSD can handle asan, ubsan, msan, tsan tests
      on 64-bit and when applicable 32-bit X86 OS.
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka
      
      Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42236
      
      llvm-svn: 322842
      ba91a689
    • Kamil Rytarowski's avatar
      Break a line into two lines · 124d5eb9
      Kamil Rytarowski authored
      This should restore the rule of <=80 characters per line.
      
      llvm-svn: 322841
      124d5eb9
    • Kamil Rytarowski's avatar
      Add new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3) · 878469cd
      Kamil Rytarowski authored
      Summary:
      getgrouplist, getgroupmembership -- calculate group access list
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: vitalybuka, joerg
      
      Reviewed By: vitalybuka
      
      Subscribers: llvm-commits, kubamracek, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42064
      
      llvm-svn: 322836
      878469cd
    • Kamil Rytarowski's avatar
      Add new interceptors: access(2), faccessat(2) · 26370ddc
      Kamil Rytarowski authored
      Summary:
      access, faccessat - check access permissions of a file or pathname
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: llvm-commits, kubamracek, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42065
      
      llvm-svn: 322831
      26370ddc
    • Kamil Rytarowski's avatar
      Add new interceptors for pwcache(3)-style functions · c815ed57
      Kamil Rytarowski authored
      Summary:
      From <pwd.h>: user_from_uid, uid_from_user
      
      From <grp.h>: group_from_gid, gid_from_group
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: kubamracek, llvm-commits, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42068
      
      llvm-svn: 322829
      c815ed57
    • Alex Shlyapnikov's avatar
      [Sanitizers] Changes in Hwasan allocator missed in D42198. · dd77ed51
      Alex Shlyapnikov authored
      Converting a few failure handler calls missed in D42198.
      
      llvm-svn: 322793
      dd77ed51
    • Alex Shlyapnikov's avatar
      [Sanitizers] Make common allocator agnostic to failure handling modes. · fd283399
      Alex Shlyapnikov authored
      Summary:
      Make common allocator agnostic to failure handling modes and move the
      decision up to the particular sanitizer's allocator, where the context
      is available (call stack, parameters, return nullptr/crash mode etc.)
      
      It simplifies the common allocator and allows the particular sanitizer's
      allocator to generate more specific and detailed error reports (which
      will be implemented later).
      
      The behavior is largely the same, except one case, the violation of the
      common allocator's check for "size + alignment" overflow is now reportied
      as OOM instead of "bad request". It feels like a worthy tradeoff and
      "size + alignment" is huge in this case anyway (thus, can be interpreted
      as not enough memory to satisfy the request). There's also a Report()
      statement added there.
      
      Reviewers: eugenis
      
      Subscribers: kubamracek, llvm-commits, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42198
      
      llvm-svn: 322784
      fd283399
    • Kostya Kortchinsky's avatar
      [scudo] Fix for the Scudo interface function scope · 33802be5
      Kostya Kortchinsky authored
      Summary:
      A forgotten include in `scudo_allocator.cpp` made the symbol only local :/
      
      Before:
      ```
      nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rss
      00024730 t __scudo_set_rss_limit
      ```
      After:
      ```
      nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rs
      00024760 T __scudo_set_rss_limit
      ```
      And we want `T`!
      
      This include also means that we can get rid of the `extern "C"` in the C++
      file, the compiler does fine without it (note that this was already the case
      for all the `__sanitizer_*` interface functions.
      
      Reviewers: alekseyshl, eugenis
      
      Reviewed By: eugenis
      
      Subscribers: #sanitizers, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42199
      
      llvm-svn: 322782
      33802be5
  7. Jan 17, 2018
    • Kostya Kortchinsky's avatar
      [scudo] Limit by default the TSD pool to 2 on Android · 255913b3
      Kostya Kortchinsky authored
      Summary:
      jemalloc on Android currently uses 2 arenas
      (https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64).
      Since the Android toolchain absorbs compiler-rt and compiles it as is, we have
      to enforce the same limit to somehow stay competitive in terms of memory usage.
      
      The changes could either go in:
      - `scudo_platform.h` with a default for Android of 2 (this is the solution
        implemented here);
      - in `CMakeLists.txt` adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android.
      - something else?
      
      I don't have a strong opinion on how to do it, but it has to be done upstream
      anyway.
      
      Reviewers: alekseyshl, eugenis
      
      Reviewed By: alekseyshl, eugenis
      
      Subscribers: srhines, #sanitizers, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42194
      
      llvm-svn: 322764
      255913b3
    • Petr Hosek's avatar
      Reland "[libFuzzer] Support using libc++" · eac2b47b
      Petr Hosek authored
      This is needed in case the users of libFuzzer use libc++ in their
      code, which the fuzz target (libFuzzer) will be linked against.
      When libc++ source is available, we build a private version of it
      and link it against libFuzzer which allows using the same static
      library against codebases which use both libc++ and libstdc++.
      
      Differential Revision: https://reviews.llvm.org/D37631
      
      llvm-svn: 322755
      eac2b47b
    • Petr Hosek's avatar
      Revert "[libFuzzer] Support using libc++" · 68bc4bd6
      Petr Hosek authored
      This reverts commit r322604: test is failing for standalone compiler-rt.
      
      llvm-svn: 322689
      68bc4bd6
    • Kamil Rytarowski's avatar
      Add new interceptor: acct(2) · b87c8fa4
      Kamil Rytarowski authored
      Summary:
      acct - enable or disable process accounting
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: kubamracek, llvm-commits, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42066
      
      llvm-svn: 322646
      b87c8fa4
    • Kamil Rytarowski's avatar
      Hotfix for test/asan/TestCases/alloca_constant_size.cc · 16289439
      Kamil Rytarowski authored
      Add missing endif.
      
      llvm-svn: 322638
      16289439
    • Kamil Rytarowski's avatar
      [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274) · 3efd1c51
      Kamil Rytarowski authored
      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
      3efd1c51
Loading