[PATCH] D100919: [AArch64] Support customizing stack protector guard

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 20 18:47:35 PDT 2021


nickdesaulniers created this revision.
nickdesaulniers added reviewers: xiangzhangllvm, efriedma, MaskRay.
Herald added subscribers: dexonsmith, danielkiss, hiraditya, kristof.beyls.
nickdesaulniers requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Follow up to D88631 <https://reviews.llvm.org/D88631> but for aarch64; the Linux kernel uses the command
line flags:

1. -mstack-protector-guard=sysreg
2. -mstack-protector-guard-reg=sp_el0
3. -mstack-protector-guard-offset=0

to use the system register sp_el0 for the stack canary, enabling the
kernel to have a unique stack canary per task (like a thread, but not
limited to userspace as the kernel can preempt itself).

Address pr/47341 for aarch64.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/289
Signed-off-by: Nick Desaulniers <ndesaulniers at google.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100919

Files:
  clang/include/clang/Basic/CodeGenOptions.h
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/stack-protector-guard.c
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/AArch64/stack-guard-sysreg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100919.339072.patch
Type: text/x-patch
Size: 9874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210421/e610905b/attachment.bin>


More information about the cfe-commits mailing list