alexcrichton opened PR #6810 from alexcrichton:fix-return-call-api-keys
to bytecodealliance:main
:
This commit fixes an issue where a
return_call
would not decrypt the return address when pointer authentication is enabled. The return address would be encrypted upon entry into the function but would never get restored later on.This addresses the issue by changing the encryption keys in use from the A/B key plus SP to instead using A/B plus the zero key. The reason for this is that during a normal function call before returning the SP value is guaranteed to be the same as it was upon entry. For tail calls though SP may be different due to differing numbers of stack arguments. This means that the modifier of SP can't be used for the tail convention.
New
APIKey
definitions were added and that now additionally represents the A/B key plus the modifier. Non-tail
calling conventions still use the same keys as before, it's just thetail
convention that's different.Closes #6799
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #6810.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #6810.
alexcrichton updated PR #6810.
alexcrichton updated PR #6810.
fitzgen submitted PR review:
Thanks for digging into this!
Is it possible to have a runtest for this? Is there a way to get qemu to enable these features?
alexcrichton updated PR #6810.
alexcrichton has enabled auto merge for PR #6810.
alexcrichton merged PR #6810.
Last updated: Nov 22 2024 at 16:03 UTC