Document ARM64 unwind handling for return address signing#4202
Conversation
|
@mstorsjo : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit 21e4902: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
@corob-msft Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, add a #label:"aq-pr-triaged" |
|
Thanks for the proposal. As near as I can tell, the actual opcode is known as To get the inside story, I'm invoking @laurenprinn and @sigatrev for their takes. (I'd invoke James McNellis, but he's moved on to smaller and more playful things at Roblox.) I don't feel qualified to sign off on my own. |
21e4902 to
1887d8c
Compare
|
@mstorsjo : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
Thanks! I've updated the PR to use the correct name for the opcode, and renumbered the steps for the packed form. |
|
Learn Build status updates of commit 1887d8c: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
sigatrev
left a comment
There was a problem hiding this comment.
The x30/lr inconsistency should be fixed, but this otherwise looks good to me.
1887d8c to
f510c83
Compare
|
@mstorsjo : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit f510c83: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
@sigatrev BTW, are you able to comment on what the Windows unwinder implementation does, if the actual code does use PAC (and running on HW that exposes it, with a Windows configuration that has taken it into use), but the unwind info is lacking these opcodes? (That's the current status quo if building code with Clang today, with |
It must be explicitly present. |
Ok, thanks for the clarification! |
|
@corob-msft : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
colin-home
left a comment
There was a problem hiding this comment.
@mstorsjo
Thanks for the useful update.
|
Learn Build status updates of commit 4547444: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
#sign-off |
This got documented upstream in MicrosoftDocs/cpp-docs#4202. Differential Revision: https://reviews.llvm.org/D135275
This was documented upstream in MicrosoftDocs/cpp-docs#4202. Differential Revision: https://reviews.llvm.org/D135276
This new opcode was initially documented as "pac_sign_return_address" in MicrosoftDocs/cpp-docs#4202, but was soon afterwards renamed into "pac_sign_lr" in MicrosoftDocs/cpp-docs#4209, as the other name was unwieldy, and there were no other external references to that name anywhere. Rename our external .seh assembler directive - it hasn't been merged for very long yet, so there's probably no external use to account for. Rename all other internal references to the opcode similarly. Differential Revision: https://reviews.llvm.org/D135762
This got documented upstream in MicrosoftDocs/cpp-docs#4202. Differential Revision: https://reviews.llvm.org/D135275
This was documented upstream in MicrosoftDocs/cpp-docs#4202. Differential Revision: https://reviews.llvm.org/D135276
This new opcode was initially documented as "pac_sign_return_address" in MicrosoftDocs/cpp-docs#4202, but was soon afterwards renamed into "pac_sign_lr" in MicrosoftDocs/cpp-docs#4209, as the other name was unwieldy, and there were no other external references to that name anywhere. Rename our external .seh assembler directive - it hasn't been merged for very long yet, so there's probably no external use to account for. Rename all other internal references to the opcode similarly. Differential Revision: https://reviews.llvm.org/D135762
This case did get documented upstream, in MicrosoftDocs/cpp-docs#4202, and the way that llvm-readobj prints it, implemented in that commit, is correct.
This case did get documented upstream, in MicrosoftDocs/cpp-docs#4202, and the way that llvm-readobj prints it, implemented in that commit, is correct.
This is deduced/guessed from studying the output of MSVC with the
/d2guardsignretflag. Hopefully someone with insight into the unwinder internals can confirm whether this indeed is the case.I made up an unwind opcode name for this opcode (0xfc,
sign_ra) - other suggestions are welcome.I'm not entirely sure about whether this is how it is handled for the packed functions, but this would intuitively be how it works.
Since there are two parallel instructions for signing return addresses,
paciaspandpacibsp, the unwinder would need to know which one to use for signing - MSVC seems to generatepacibsp(togeter withautibsp) - is there any other similar opcode forpaciasp, or is that one unsupported for Windows unwinding purposes?