1. Jul 25, 2017
  2. Jul 24, 2017
    • Michael Kruse's avatar
      [ForwardOpTree] Properly indent enumeration in comment. NFC. · 54071126
      Michael Kruse authored
      llvm-svn: 308887
      54071126
    • Michael Kruse's avatar
      [ForwardOpTree] Rename FD_CanForward to FD_CanForwardLeaf. NFC. · 67752076
      Michael Kruse authored
      To make the meaning and distinction to FD_CanForwardTree clearer.
      
      llvm-svn: 308886
      67752076
    • Michael Kruse's avatar
      [ForwardOpTree] Add comments to ForwardingDecision items. NFC. · d85e345c
      Michael Kruse authored
      In particular, explain the difference between FD_CanForward
      and FD_CanForwardTree.
      
      llvm-svn: 308885
      d85e345c
    • Kostya Kortchinsky's avatar
      [scudo] Quarantine overhaul · 2d94405a
      Kostya Kortchinsky authored
      Summary:
      First, some context.
      
      The main feedback we get about the quarantine is that it's too memory hungry.
      A single MB of quarantine will have an impact of 3 to 4MB of PSS/RSS, and
      things quickly get out of hand in terms of memory usage, and the quarantine
      ends up disabled.
      
      The main objective of the quarantine is to protect from use-after-free
      exploitation by making it harder for an attacker to reallocate a controlled
      chunk in place of the targeted freed chunk. This is achieved by not making it
      available to the backend right away for reuse, but holding it a little while.
      
      Historically, what has usually been the target of such attacks was objects,
      where vtable pointers or other function pointers could constitute a valuable
      targeti to replace. Those are usually on the smaller side. There is barely any
      advantage in putting the quarantine several megabytes of RGB data or the like.
      
      Now for the patch.
      
      This patch introduces a new way the Quarantine behaves in Scudo. First of all,
      the size of the Quarantine will be defined in KB instead of MB, then we
      introduce a new option: the size up to which (lower than or equal to) a chunk
      will be quarantined. This way, we only quarantine smaller chunks, and the size
      of the quarantine remains manageable. It also prevents someone from triggering
      a recycle by allocating something huge. We default to 512 bytes on 32-bit and
      2048 bytes on 64-bit platforms.
      
      In details, the patches includes the following:
      - introduce `QuarantineSizeKb`, but honor `QuarantineSizeMb` if set to fall
        back to the old behavior (meaning no threshold in that case);
        `QuarantineSizeMb` is described as deprecated in the options descriptios;
        documentation update will follow;
      - introduce `QuarantineChunksUpToSize`, the new threshold value;
      - update the `quarantine.cpp` test, and other tests using `QuarantineSizeMb`;
      - remove `AllocatorOptions::copyTo`, it wasn't used;
      - slightly change the logic around `quarantineOrDeallocateChunk` to accomodate
        for the new logic; rename a couple of variables there as well;
      
      Rewriting the tests, I found a somewhat annoying bug where non-default aligned
      chunks would account for more than needed when placed in the quarantine due to
      `<< MinAlignment` instead of `<< MinAlignmentLog`. This is fixed and tested for
      now.
      
      Reviewers: alekseyshl, kcc
      
      Reviewed By: alekseyshl
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35694
      
      llvm-svn: 308884
      2d94405a
    • Alexey Bataev's avatar
      [OPENMP] Fix the restrictions for in_reduction clause. · f189cb79
      Alexey Bataev authored
      This patch allows to use in_reduction clause even if the innermost
      directive is not taskgroup.
      
      llvm-svn: 308883
      f189cb79
    • Krasimir Georgiev's avatar
      [clang-format] Fix comment levels between '} else {' and PPDirective. · 3e051054
      Krasimir Georgiev authored
      Summary:
      This fixes a regression exposed by r307795 and rL308725 in which the level of a
      comment line between '} else {' and a preprocessor directive is incorrectly set
      as the level of the '} else {' line. For example, this :
      ```
      int f(int i) {
        if (i) {
          ++i;
        } else {
          // comment
      #ifdef A
          --i;
      #endif
        }
      }
      ```
      was formatted as:
      ```
      int f(int i) {
        if (i) {
          ++i;
        } else {
        // comment
      #ifdef A
          --i;
      #endif
        }
      }
      ```
      
      Reviewers: djasper, klimek
      
      Reviewed By: klimek
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35794
      
      llvm-svn: 308882
      3e051054
    • Francis Ricci's avatar
      4f827176
    • Marshall Clow's avatar
      make sure that we don't call basic_streambuf::gbump with a value bigger than... · e5cc2fcc
      Marshall Clow authored
      make sure that we don't call basic_streambuf::gbump with a value bigger than INT_MAX, since it only takes an int. Related to, but not quite the same as PR33725
      
      llvm-svn: 308880
      e5cc2fcc
    • Simon Dardis's avatar
      [mips] Add support for -m(no-)extern-data. · 7d318786
      Simon Dardis authored
      Add support for -m(no-)extern-data when using -mgpopt in the driver. It is
      enabled by default in the backend.
      
      Reviewers: atanasyan, slthakur
      
      Differential Revision: https://reviews.llvm.org/D35550
      
      llvm-svn: 308879
      7d318786