[all-commits] [llvm/llvm-project] 9930f3: [AArch64] Fix case of 0 dynamic alloc when stack p...

Oskar Wirga via All-commits all-commits at lists.llvm.org
Sun Dec 10 05:01:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9930f3e2982cd590b75f1252ea5253e53401b605
      https://github.com/llvm/llvm-project/commit/9930f3e2982cd590b75f1252ea5253e53401b605
  Author: Oskar Wirga <10386631+oskarwirga at users.noreply.github.com>
  Date:   2023-12-10 (Sun, 10 Dec 2023)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/test/CodeGen/AArch64/stack-probing-64k.ll
    M llvm/test/CodeGen/AArch64/stack-probing-dynamic.ll
    M llvm/test/CodeGen/AArch64/stack-probing-sve.ll
    M llvm/test/CodeGen/AArch64/stack-probing.ll

  Log Message:
  -----------
  [AArch64] Fix case of 0 dynamic alloc when stack probing (#74877)

 I accidentally closed
https://github.com/llvm/llvm-project/pull/74806

If the dynamic allocation size is 0, then we will still probe the
current sp value despite not decrementing sp! This results in
overwriting stack data, in my case the stack canary.

The fix here is just to load the value of [sp] into xzr which is
essentially a no-op but still performs a read/probe of the new page.




More information about the All-commits mailing list