Skip to content
  1. Jun 23, 2015
  2. Jun 22, 2015
    • Peter Collingbourne's avatar
      SafeStack: Create the unsafe stack pointer on demand. · de26a918
      Peter Collingbourne authored
      This avoids creating an unnecessary undefined reference on targets such as
      NVPTX that require such references to be declared in asm output.
      
      llvm-svn: 240321
      de26a918
    • Chandler Carruth's avatar
      [PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class. · c3f49eb4
      Chandler Carruth authored
      This will allow classes to implement the AA interface without deriving
      from the class or referencing an internal enum of some other class as
      their return types.
      
      Also, to a pretty fundamental extent, concepts such as 'NoAlias',
      'MayAlias', and 'MustAlias' are first class concepts in LLVM and we
      aren't saving anything by scoping them heavily.
      
      My mild preference would have been to use a scoped enum, but that
      feature is essentially completely broken AFAICT. I'm extremely
      disappointed. For example, we cannot through any reasonable[1] means
      construct an enum class (or analog) which has scoped names but converts
      to a boolean in order to test for the possibility of aliasing.
      
      [1]: Richard Smith came up with a "solution", but it requires class
      templates, and lots of boilerplate setting up the enumeration multiple
      times. Something like Boost.PP could potentially bundle this up, but
      even that would be quite painful and it doesn't seem realistically worth
      it. The enum class solution would probably work without the need for
      a bool conversion.
      
      Differential Revision: http://reviews.llvm.org/D10495
      
      llvm-svn: 240255
      c3f49eb4
  3. Jun 20, 2015
  4. Jun 19, 2015
  5. Jun 18, 2015
  6. Jun 17, 2015
  7. Jun 16, 2015
  8. Jun 15, 2015
    • Peter Collingbourne's avatar
      Protection against stack-based memory corruption errors using SafeStack · 82437bf7
      Peter Collingbourne authored
      This patch adds the safe stack instrumentation pass to LLVM, which separates
      the program stack into a safe stack, which stores return addresses, register
      spills, and local variables that are statically verified to be accessed
      in a safe way, and the unsafe stack, which stores everything else. Such
      separation makes it much harder for an attacker to corrupt objects on the
      safe stack, including function pointers stored in spilled registers and
      return addresses. You can find more information about the safe stack, as
      well as other parts of or control-flow hijack protection technique in our
      OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf)
      and our project website (http://levee.epfl.ch).
      
      The overhead of our implementation of the safe stack is very close to zero
      (0.01% on the Phoronix benchmarks). This is lower than the overhead of
      stack cookies, which are supported by LLVM and are commonly used today,
      yet the security guarantees of the safe stack are strictly stronger than
      stack cookies. In some cases, the safe stack improves performance due to
      better cache locality.
      
      Our current implementation of the safe stack is stable and robust, we
      used it to recompile multiple projects on Linux including Chromium, and
      we also recompiled the entire FreeBSD user-space system and more than 100
      packages. We ran unit tests on the FreeBSD system and many of the packages
      and observed no errors caused by the safe stack. The safe stack is also fully
      binary compatible with non-instrumented code and can be applied to parts of
      a program selectively.
      
      This patch is our implementation of the safe stack on top of LLVM. The
      patches make the following changes:
      
      - Add the safestack function attribute, similar to the ssp, sspstrong and
        sspreq attributes.
      
      - Add the SafeStack instrumentation pass that applies the safe stack to all
        functions that have the safestack attribute. This pass moves all unsafe local
        variables to the unsafe stack with a separate stack pointer, whereas all
        safe variables remain on the regular stack that is managed by LLVM as usual.
      
      - Invoke the pass as the last stage before code generation (at the same time
        the existing cookie-based stack protector pass is invoked).
      
      - Add unit tests for the safe stack.
      
      Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
      Lab at EPFL; updates and upstreaming by myself.
      
      Differential Revision: http://reviews.llvm.org/D6094
      
      llvm-svn: 239761
      82437bf7
  9. Jun 13, 2015
    • Benjamin Kramer's avatar
      [Statepoints] Skip a vector copy when uniquing values. · 258ea0db
      Benjamin Kramer authored
      No functionality change intended.
      
      llvm-svn: 239688
      258ea0db
    • Matt Wala's avatar
      Revert 239644. · bfb5368c
      Matt Wala authored
      llvm-svn: 239650
      bfb5368c
    • Matt Wala's avatar
      [Scalarizer] Fix potential for stale data in Scattered across invocations · 1f48192d
      Matt Wala authored
      Summary:
      Scalarizer has two data structures that hold information about changes
      to the function, Gathered and Scattered. These are cleared in finish()
      at the end of runOnFunction() if finish() detects any changes to the
      function. 
      
      However, finish() was checking for changes by only checking if
      Gathered was non-empty. The function visitStore() only modifies
      Scattered without touching Gathered. As a result, Scattered could have
      ended up having stale data if Scalarizer only scalarized store
      instructions. Since the data in Scattered is used during the execution
      of the pass, this introduced dangling pointer errors. 
      
      The fix is to check whether both Scattered and Gathered are empty
      before deciding what to do in finish().
      
      Reviewers: srhines
      
      Reviewed By: srhines
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D10422
      
      llvm-svn: 239644
      1f48192d
  10. Jun 12, 2015
Loading