Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[AArch64] cfi_negate_ra_state emitted incorrectly. #137802

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

Closed
DanielKristofKiss opened this issue Apr 29, 2025 · 1 comment · Fixed by #137795
Closed

[AArch64] cfi_negate_ra_state emitted incorrectly. #137802

DanielKristofKiss opened this issue Apr 29, 2025 · 1 comment · Fixed by #137795
Assignees
Labels
backend:AArch64 regression:20 Regression in 20 release

Comments

@DanielKristofKiss
Copy link
Member

.cfi_negate_ra_state is emitted before the corresponding instruction which is incorrect.
Debuggers or unwinders might not able to unwind the frames correctly.

This is a regression on the 20.x release (19.x is not affected): #137800
revert on the mainline: #137795

@llvmbot
Copy link
Member

llvmbot commented Apr 29, 2025

@llvm/issue-subscribers-backend-aarch64

Author: Daniel Kiss (DanielKristofKiss)

`.cfi_negate_ra_state` is emitted before the corresponding instruction which is incorrect. Debuggers or unwinders might not able to unwind the frames correctly.

This is a regression on the 20.x release (19.x is not affected): #137800
revert on the mainline: #137795

DanielKristofKiss added a commit to DanielKristofKiss/llvm-project that referenced this issue May 6, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in LLVM Release Status May 6, 2025
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this issue May 7, 2025
…ion (llvm#137795)

This reverts partially this commit
0b73b5a.
This is not a clear revert because other changes already landed.
CFI directives like `.cfi_negate_ra_state` must be emitted after the
instruction.
If the execution is stopped before the `paciasp` instruction is executed
the debugger/unwinder would try to authenticated the return address as
the `.cfi_negate_ra_state` already indicates it got signed.

fixes: llvm#137802
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 regression:20 Regression in 20 release
Projects
2 participants