-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8319747: galoisCounterMode_AESCrypt stack walking broken #16567
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
Conversation
👋 Welcome back djelinski! A progress list of the required criteria for merging this PR into |
@djelinski The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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.
Looks good. Please run tier3 too which will execute the test as part for hotspot_vector_2
group with different AVX settings.
@djelinski This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 65 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@@ -240,10 +240,10 @@ address StubGenerator::generate_galoisCounterMode_AESCrypt() { | |||
const Address state_mem(rbp, 7 * wordSize); | |||
const Register state = r13; | |||
const Address subkeyH_mem(rbp, 8 * wordSize); | |||
const Register subkeyHtbl = r14; | |||
const Register avx512_subkeyHtbl = r12; | |||
const Register subkeyHtbl = r11; |
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.
Changing the register from r14 to r11 here doesn't look correct. As aesgcm_encrypt() uses r11 as temporary for windows at line 3046 and overwrites it at line 3074 etc in the original code.
3046 const Register ghash_pos = NOT_WIN64( r14) WIN64_ONLY( r11 );
3074 __ movl(ghash_pos, 0); // Pointer for ghash read and store operations
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.
Ah, you're right! I missed that. I was looking for #ifdef
s, and forgot that we have the *_ONLY
macros.
The code works correctly because subkeyHtbl
and ghash_pos
have non-overlapping lifetimes; subkeyHtbl
is last used in line:
3072 __ call(GENERATE_HTBL_48_BLKS, relocInfo::none);
I'd like to make this explicit by changing the code like:
// reuse subkeyHtbl register - the lifetimes do not overlap
const Register ghash_pos = subkeyHtbl;
but I can also revert the register renaming changes. What's your preference?
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 reverted register renaming to keep this PR focused on stack walking. Tests still pass.
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.
Looks good to me.
Thanks for the reviews! /integrate |
Going to push as commit faeea07.
Your commit was automatically rebased without conflicts. |
@djelinski Pushed as commit faeea07. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR fixes stack walking by removing incorrect RBP change in the middle of a stub.
I also changed the register assignment to avoid saving RSI on Windows.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16567/head:pull/16567
$ git checkout pull/16567
Update a local copy of the PR:
$ git checkout pull/16567
$ git pull https://git.openjdk.org/jdk.git pull/16567/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16567
View PR using the GUI difftool:
$ git pr show -t 16567
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16567.diff
Webrev
Link to Webrev Comment