This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Stack probing for dynamic allocas in SelectionDAG
Needs ReviewPublic

Authored by ostannard on Feb 4 2021, 2:28 AM.

Details

Summary

This adds a stack probing instruction sequence for dynamic stack
allocations, to protect against stack clash attacks. The instruction
sequence used is the same one used for unknown-size allocations in
function prologues.

This patch only applies to the SelectionDAG instruction selector,
GlobalISel support will be added in a later patch.

Diff Detail

Event Timeline

ostannard created this revision.Feb 4 2021, 2:28 AM
ostannard requested review of this revision.Feb 4 2021, 2:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2021, 2:28 AM
lkail added a subscriber: lkail.Feb 5 2021, 2:14 AM
ostannard updated this revision to Diff 321687.Feb 5 2021, 2:37 AM
alex added a subscriber: alex.Feb 22 2021, 4:32 PM
ostannard planned changes to this revision.Mar 9 2021, 9:11 AM

While writing the comment in D98258, I noticed that we also move the stack pointer down for calls when a reserved call frame can't be used, which isn't probed by this patch.

ostannard updated this revision to Diff 329384.Mar 9 2021, 10:34 AM
ostannard added a reviewer: kristof.beyls.
  • Rebase
  • Also probe space allocated for outgoing call arguments when needed
emaste added a subscriber: emaste.Aug 23 2021, 12:03 PM

Hi, does anyone have time to review the latest version of this patch?

Hi, does anyone have time to review the latest version of this patch?

I could be wrong, but I don't think there's been any updates since March? most of the feedback was given on https://reviews.llvm.org/D96004

Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2023, 11:13 AM