Skip to content
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

aarch64: Fix AuthenticatedRet when stack bytes are popped #6634

Conversation

alexcrichton
Copy link
Member

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

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
@alexcrichton alexcrichton requested a review from a team as a code owner June 23, 2023 02:29
@alexcrichton alexcrichton requested review from elliottt and removed request for a team June 23, 2023 02:29
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Jun 23, 2023
Copy link
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@alexcrichton alexcrichton added this pull request to the merge queue Jun 23, 2023
Merged via the queue into bytecodealliance:main with commit 2d34b46 Jun 23, 2023
@alexcrichton alexcrichton deleted the fix-aarch64-authenticate-ret-pop-bytes branch June 23, 2023 14:18
@fitzgen
Copy link
Member

fitzgen commented Jun 23, 2023

Whoops, thanks for catching this!

alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request 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
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "tail" calling convention is not working with AArch64 pointer address signing
3 participants