[PATCH] D112768: [ARM] implement support for TLS register based stack protector

Ard Biesheuvel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 28 16:09:22 PDT 2021


ardb created this revision.
ardb added reviewers: nickdesaulniers, peter.smith, nathanchance, kees.
Herald added subscribers: hiraditya, kristof.beyls.
ardb requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Implement support for loading the stack canary from a memory location held in 
the TLS register, with an optional offset applied. This is used by the Linux
kernel to implement per-task stack canaries, which is impossible on SMP systems
when using a global variable for the stack canary.

This also involves implementing LOAD_STACK_GUARD for other ARM targets than 
Mach-O.

Suggestions for how to test this and where to insert the test code into the 
tree are kindly welcomed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112768

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/stack-protector-guard.c
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMInstrInfo.cpp
  llvm/lib/Target/ARM/Thumb2InstrInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112768.383188.patch
Type: text/x-patch
Size: 8868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211028/bb187590/attachment.bin>


More information about the cfe-commits mailing list