-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Arm-64: Add initial support for PAC-RET #110472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@SwapnilGaikwad - once you resolve the stack walking problem, can you also try something like this in a Foo() method? paciasp
stp fp, lr, [sp, #-0x10]!
mov x9, [sp] ; overwrite lr value with random content
...
...
xpaclri ; will fail and should give the call stack
... |
- Add support for 'pac_sign_lr' unwind code - Use authenticate instruciton instead of stripping PAC in epilog
|
@dotnet/samsung Could you please take a look? These changes may be related to riscv64. |
| return (PCODE)context->Pc; | ||
| #elif defined(TARGET_ARM64) | ||
| return (PCODE)context->Pc; | ||
| return (PCODE) PacStripPtr((void *)context->Pc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move these strip operations to the source while populating the context. These are temporarily added until we get all the CI issues fixed.
|
Have we tried running the diagnostic tests on this yet? |
RISC-V Release-CLR-QEMU: 9080 / 9110 (99.67%)report.xml, report.md, failures.xml, testclr_details.tar.zst Build information and commandsGIT: |
RISC-V Release-CLR-VF2: 9083 / 9113 (99.67%)report.xml, report.md, failures.xml, testclr_details.tar.zst RISC-V Release-CLR-QEMU: 9082 / 9112 (99.67%)report.xml, report.md, failures.xml, testclr_details.tar.zst Build information and commandsGIT: |
@steveisok is doing this now |
|
@dotnet/samsung Could you please take a look? These changes may be related to riscv64. |
|
Moved to .NET 11. |
|
@dotnet/samsung Could you please take a look? These changes may be related to riscv64. |
|
We will resume the work in .NET 11. |
|
@SwapnilGaikwad, I think this PR needs some work as discussed offline. Can we change this PR to draft until it is ready to review? |
This PR introduces initial support for Pointer Authentication (PAC) on Arm64. PAC is a hardware security feature designed to mitigate Return-Oriented Programming (ROP) attacks by cryptographically signing return addresses. The signed return address is stored on the stack and later authenticated before returning from a function, ensuring control flow returns to the intended caller.
More details on PAC and its role in software security can be found (here).
Enabling PAC involves inserting additional instructions into both the function prolog (for signing) and epilog (for authentication). This results in increased code size. For example, we observe a 1.8% increase in code size across System*.dll assemblies compiled using crossgen2.
The added instructions also introduce some runtime overhead. In our benchmark of Orchard CMS 9.0, we observe a 1.3% performance regression, which falls within the noise range (standard deviation: ~1.3%).
@kunalspathak @janvorli @a74nh
Contributes to #109457