-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8279545: Buffer overrun in reverse_words of sharedRuntime_x86_64.cpp:3517 #7053
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 hseigel! A progress list of the required criteria for merging this PR into |
/label add hotspot-runtime |
@hseigel |
Webrevs
|
@@ -3246,8 +3246,8 @@ void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, | |||
// Make very sure we don't use so much space that the stack might | |||
// overflow. 512 jints corresponds to an 16384-bit integer and | |||
// will use here a total of 6k bytes of stack space. | |||
guarantee(longwords <= 341, "must be"); |
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 was mystified about this number. Can you make this instead like:
int thing = sizeof (unsigned long) * 3;
guarantee(longwords <= 8192 / thing, "must be");
Or is division just as unsafe?
Should this be uint64_t, not long ? Or change it to julong if it's a small change to match the x86 version.
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.
How about just: guarantee(longwords <= 8092 / (sizeof(julong) * 3), "must be"); ?
I don't think that doing division is a problem.
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, thanks!
@hseigel 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 26 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 |
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.
Lois
Thanks Coleen and Lois for the reviews! /integrate |
Going to push as commit 35734ad.
Your commit was automatically rebased without conflicts. |
Please review this small fix to prevent a potential integer overflow that can cause a buffer overrun. The fix was tested with Mach5 tiers 1-2 on Linux, Mac OS, and Windows, Mach5 tiers 3-5 on Linux x64, and Mach5 builds of the JDK on PPC and S390.
Thanks, Harold
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7053/head:pull/7053
$ git checkout pull/7053
Update a local copy of the PR:
$ git checkout pull/7053
$ git pull https://git.openjdk.java.net/jdk pull/7053/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7053
View PR using the GUI difftool:
$ git pr show -t 7053
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7053.diff