-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
The "tail" calling convention is not working with AArch64 pointer address signing #6567
Labels
cranelift:area:aarch64
Issues related to AArch64 backend.
Comments
With some tweaks I could reproduce this in QEMU. I downloaded and built QEMU 8.0.2 (not sure if that's required it's just the latest) and then changed this condition to always return
and this in another window:
which I think reproduces the issue (although I'm not 100% sure, but it's at least the same crashing address as it was natively) |
fitzgen
changed the title
Tail calls seem incompatible with AArch64 pointer address signing
The "tail" calling convention is not working with AArch64 pointer address signing
Jun 13, 2023
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this issue
Jun 23, 2023
This commit fixes an accidental issue with bytecodealliance#6478 where when pointer authentication was enabled and stack bytes are being popped during a return this didn't work. In this situation an authenticated return instruction was used, such as `retab`, and no extra stack bytes were popped. The fix here is to use the non-`retab` path which handles stack bytes being popped if there are stack bytes to pop. Closes bytecodealliance#6567
github-merge-queue bot
pushed a commit
that referenced
this issue
Jun 23, 2023
* aarch64: Fix `AuthenticatedRet` when stack bytes are popped This commit fixes an accidental issue with #6478 where when pointer authentication was enabled and stack bytes are being popped during a return this didn't work. In this situation an authenticated return instruction was used, such as `retab`, and no extra stack bytes were popped. The fix here is to use the non-`retab` path which handles stack bytes being popped if there are stack bytes to pop. Closes #6567 * Still use `retab` for `is_hint: false`
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this issue
Jun 27, 2023
…alliance#6634) * aarch64: Fix `AuthenticatedRet` when stack bytes are popped This commit fixes an accidental issue with bytecodealliance#6478 where when pointer authentication was enabled and stack bytes are being popped during a return this didn't work. In this situation an authenticated return instruction was used, such as `retab`, and no extra stack bytes were popped. The fix here is to use the non-`retab` path which handles stack bytes being popped if there are stack bytes to pop. Closes bytecodealliance#6567 * Still use `retab` for `is_hint: false`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Locally on an AArch64 macbook I get:
If I comment out the
target aarch64 has_pauth sign_return_address
directive the test passes, and the first test that fails is:Running in a debugger isn't too useful because the crashing thread says it's at address
0x0000000000000037
I don't know much about pointer authentication myself, but stepping through in a debugger this is the entire function
tail_caller_stack_args
with the highlighted instruction where when at that instruction the debugger no longer produces a backtrace:The disassembly of
tail_callee_stack_args
looks like:The text was updated successfully, but these errors were encountered: