-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8368997: AIX allows reading from address zero which leads to several ubsan findings #27591
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 jkern! A progress list of the required criteria for merging this PR into |
|
@JoKern65 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 86 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 |
TheRealMDoerr
left a comment
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 think this is fine. Hotspot should never read from address 0, so returning false should be ok. This essentially emulates the behavior of other operating systems.
Should we only catch adr == nullptr or all addresses within the first memory page?
I would prefer to catch only the nullptr, because this is standard conform. |
|
/integrate |
|
Going to push as commit 692c20c.
Your commit was automatically rebased without conflicts. |
In _SafeFetchXX_internal() a pointer is checked for readability before using. It returns false if this is not the case. The implementation tries to read from the pointer if this is not feasible the signal handler comes into place jumping back to the function via longjmp, so the _SafeFetchXX_internal() itself can return with a false and a null as pseudo content of the address. If the address was readable the function returns true and provides the content of the address.
Because AIX allows reading from address zero, _SafeFetchXX_internal() returns true and follow up functions using the address are called. All these functions end up in an UBSAN finding regarding reading from zero.
The solution could be to manually code that also AIX behaves like other operating systems and returns false and the content zero in case of address zero. Then no UBSAN finding occur.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27591/head:pull/27591$ git checkout pull/27591Update a local copy of the PR:
$ git checkout pull/27591$ git pull https://git.openjdk.org/jdk.git pull/27591/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27591View PR using the GUI difftool:
$ git pr show -t 27591Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27591.diff
Using Webrev
Link to Webrev Comment