[stack protector] Fix a potential security bug in stack protector where the
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 25 Jul 2014 19:31:34 +0000 (19:31 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 25 Jul 2014 19:31:34 +0000 (19:31 +0000)
commit0651a556fe14ed9d2c8250b4918d441f2cd1708a
treebadb84243faf7df61692d1fa363635dc2a11c844
parent24dfa53b8acc934995c247ee7a630781ddc80a56
[stack protector] Fix a potential security bug in stack protector where the
address of the stack guard was being spilled to the stack.

Previously the address of the stack guard would get spilled to the stack if it
was impossible to keep it in a register. This patch introduces a new target
independent node and pseudo instruction which gets expanded post-RA to a
sequence of instructions that load the stack guard value. Register allocator
can now just remat the value when it can't keep it in a register.

<rdar://problem/12475629>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213967 91177308-0d34-0410-b5e6-96231b3b80d8
26 files changed:
include/llvm/Target/Target.td
include/llvm/Target/TargetLowering.h
include/llvm/Target/TargetOpcodes.h
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Target/AArch64/AArch64InstrInfo.cpp
lib/Target/AArch64/AArch64InstrInfo.h
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/ARM/ARMInstrInfo.cpp
lib/Target/ARM/ARMInstrInfo.h
lib/Target/ARM/Thumb1InstrInfo.cpp
lib/Target/ARM/Thumb1InstrInfo.h
lib/Target/ARM/Thumb2InstrInfo.cpp
lib/Target/ARM/Thumb2InstrInfo.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/AArch64/stack_guard_remat.ll [new file with mode: 0644]
test/CodeGen/ARM/stack_guard_remat.ll [new file with mode: 0644]
test/CodeGen/X86/stack_guard_remat.ll [new file with mode: 0644]
utils/TableGen/CodeGenTarget.cpp