freebsd-dev/contrib/llvm/lib
Dimitry Andric ba9b2ede8a Pull in r366369 from upstream llvm trunk (by Francis Visoiu Mistrih):
[CodeGen][NFC] Simplify checks for stack protector index checking

  Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex()
  >= 0`.

Pull in r366371 from upstream llvm trunk (by Francis Visoiu Mistrih):

  [PEI] Don't re-allocate a pre-allocated stack protector slot

  The LocalStackSlotPass pre-allocates a stack protector and makes sure
  that it comes before the local variables on the stack.

  We need to make sure that later during PEI we don't re-allocate a new
  stack protector slot. If that happens, the new stack protector slot
  will end up being **after** the local variables that it should be
  protecting.

  Therefore, we would have two slots assigned for two different stack
  protectors, one at the top of the stack, and one at the bottom. Since
  PEI will overwrite the assigned slot for the stack protector, the
  load that is used to compare the value of the stack protector will
  use the slot assigned by PEI, which is wrong.

  For this, we need to check if the object is pre-allocated, and re-use
  that pre-allocated slot.

  Differential Revision: https://reviews.llvm.org/D64757

Pull in r367068 from upstream llvm trunk (by Francis Visoiu Mistrih):

  [CodeGen] Don't resolve the stack protector frame accesses until PEI

  Currently, stack protector loads and stores are resolved during
  LocalStackSlotAllocation (if the pass needs to run). When this is the
  case, the base register assigned to the frame access is going to be
  one of the vregs created during LocalStackSlotAllocation. This means
  that we are keeping a pointer to the stack protector slot, and we're
  using this pointer to load and store to it.

  In case register pressure goes up, we may end up spilling this
  pointer to the stack, which can be a security concern.

  Instead, leave it to PEI to resolve the frame accesses. In order to
  do that, we make all stack protector accesses go through frame index
  operands, then PEI will resolve this using an offset from sp/fp/bp.

  Differential Revision: https://reviews.llvm.org/D64759

Together, these fix a issue where the stack protection feature in LLVM's
ARM backend can be rendered ineffective when the stack protector slot is
re-allocated so that it appears after the local variables that it is
meant to protect, leaving the function potentially vulnerable to a
stack-based buffer overflow.

Reported by:	andrew
Security:	https://kb.cert.org/vuls/id/129209/
MFC after:	3 days
2019-07-26 18:49:20 +00:00
..
Analysis Pull in r360968 from upstream llvm trunk (by Philip Reames): 2019-07-01 21:06:10 +00:00
AsmParser Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
BinaryFormat Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Bitcode Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
CodeGen Pull in r366369 from upstream llvm trunk (by Francis Visoiu Mistrih): 2019-07-26 18:49:20 +00:00
DebugInfo Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, 2019-06-12 21:10:37 +00:00
Demangle Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
ExecutionEngine Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
FuzzMutate Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
IR Merge llvm, clang, compiler-rt, libc++, lld, and lldb release_80 branch 2019-02-05 19:48:24 +00:00
IRReader Merge llvm trunk r338150, and resolve conflicts. 2018-07-30 16:33:32 +00:00
LineEditor Update llvm to release_39 branch r276489, and resolve conflicts. 2016-08-16 21:02:59 +00:00
Linker Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
LTO Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
MC Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, 2019-06-12 21:10:37 +00:00
MCA Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Object Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, 2019-06-12 21:10:37 +00:00
ObjectYAML Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Option Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
OptRemarks Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Passes Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
ProfileData Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Support Merge llvm, clang, compiler-rt, libc++, lld, and lldb release_80 branch 2019-02-15 21:44:42 +00:00
TableGen Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Target powerpc: Transition to Secure-PLT, like most other OSs (Toolchain part) 2019-06-25 02:35:22 +00:00
Testing/Support Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
TextAPI/ELF Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
ToolDrivers Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00
Transforms Pull in r360968 from upstream llvm trunk (by Philip Reames): 2019-07-01 21:06:10 +00:00
WindowsManifest Merge llvm trunk r321017 to contrib/llvm. 2017-12-20 14:16:56 +00:00
XRay Merge llvm trunk r351319, resolve conflicts, and update FREEBSD-Xlist. 2019-01-20 11:41:25 +00:00