[all-commits] [llvm/llvm-project] 0f4177: [AArch64] Support customizing stack protector guard

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Mon May 17 11:49:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f417789192e74f9d2fad0f6aee4efc394257176
      https://github.com/llvm/llvm-project/commit/0f417789192e74f9d2fad0f6aee4efc394257176
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2021-05-17 (Mon, 17 May 2021)

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

  Log Message:
  -----------
  [AArch64] Support customizing stack protector guard

Follow up to 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>

Reviewed By: xiangzhangllvm, DavidSpickett, dmgreen

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




More information about the All-commits mailing list