[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)
commite5b6e0d2313cdd5b906bfeaf3968ff7fdd6438db
treed1258a082055dc5b5ea479d6e2072d795a281568
parenta74e3f0c51487108c5b8afa54b83896a81660a43
[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>

llvm-svn: 213967
26 files changed:
llvm/include/llvm/Target/Target.td
llvm/include/llvm/Target/TargetLowering.h
llvm/include/llvm/Target/TargetOpcodes.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/lib/Target/ARM/ARMInstrInfo.cpp
llvm/lib/Target/ARM/ARMInstrInfo.h
llvm/lib/Target/ARM/Thumb1InstrInfo.cpp
llvm/lib/Target/ARM/Thumb1InstrInfo.h
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
llvm/lib/Target/ARM/Thumb2InstrInfo.h
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/test/CodeGen/AArch64/stack_guard_remat.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/stack_guard_remat.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/stack_guard_remat.ll [new file with mode: 0644]
llvm/utils/TableGen/CodeGenTarget.cpp