Skip to content

8277822: Remove debug-only heap overrun checks in os::malloc and friends #1041

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

Closed
wants to merge 1 commit into from

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented Jan 9, 2023

After we backported "8275320: NMT should perform buffer overrun checks", I'd like to backport this one as well.This change removes now redundant overrun checks from os::malloc and friends.

Not a clean backport, but the fix is small. There had been a security fix: "8286519: Better memory handling" sits in the middle of the backporting chains. It did introduce a size overflow check that I had to move and adapt (lines 694-697).

  // Check for overflow.
  if (outer_size < size) {
    return NULL;
  }

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8277822: Remove debug-only heap overrun checks in os::malloc and friends

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev pull/1041/head:pull/1041
$ git checkout pull/1041

Update a local copy of the PR:
$ git checkout pull/1041
$ git pull https://git.openjdk.org/jdk17u-dev pull/1041/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1041

View PR using the GUI difftool:
$ git pr show -t 1041

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/1041.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 9, 2023

👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title Backport 39b1d75f25ff2cc348f8b69d4e280847c6843ae2 8277822: Remove debug-only heap overrun checks in os::malloc and friends Jan 9, 2023
@openjdk
Copy link

openjdk bot commented Jan 9, 2023

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport Port of a pull request already in a different code base label Jan 9, 2023
@tstuefe tstuefe marked this pull request as ready for review January 9, 2023 15:57
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 9, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 9, 2023

Webrevs

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

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

Lgtm.

@openjdk
Copy link

openjdk bot commented Jan 9, 2023

@tstuefe 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:

8277822: Remove debug-only heap overrun checks in os::malloc and friends

Reviewed-by: phh

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 5 new commits pushed to the master branch:

  • 339b93b: 8297431: [JVMCI] HotSpotJVMCIRuntime.encodeThrowable should not throw an exception
  • b427938: 8297569: URLPermission constructor throws IllegalArgumentException: Invalid characters in hostname after JDK-8294378
  • ad04159: 8296912: C2: CreateExNode::Identity fails with assert(i < _max) failed: oob: i=1, _max=1
  • d784aae: 8276064: CheckCastPP with raw oop input floats below a safepoint
  • cf6c041: 8299439: java/text/Format/NumberFormat/CurrencyFormat.java fails for hr_HR

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 9, 2023
@tstuefe
Copy link
Member Author

tstuefe commented Jan 10, 2023

Lgtm.

Thank you Paul!

@tstuefe
Copy link
Member Author

tstuefe commented Jan 10, 2023

Got approval

/integrate

@openjdk
Copy link

openjdk bot commented Jan 10, 2023

Going to push as commit 1dc6a38.
Since your change was applied there have been 6 commits pushed to the master branch:

  • c370dec: 8298271: java/security/SignedJar/spi-calendar-provider/TestSPISigned.java failing on Windows
  • 339b93b: 8297431: [JVMCI] HotSpotJVMCIRuntime.encodeThrowable should not throw an exception
  • b427938: 8297569: URLPermission constructor throws IllegalArgumentException: Invalid characters in hostname after JDK-8294378
  • ad04159: 8296912: C2: CreateExNode::Identity fails with assert(i < _max) failed: oob: i=1, _max=1
  • d784aae: 8276064: CheckCastPP with raw oop input floats below a safepoint
  • cf6c041: 8299439: java/text/Format/NumberFormat/CurrencyFormat.java fails for hr_HR

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 10, 2023
@openjdk openjdk bot closed this Jan 10, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 10, 2023
@openjdk
Copy link

openjdk bot commented Jan 10, 2023

@tstuefe Pushed as commit 1dc6a38.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@tstuefe tstuefe deleted the tstuefe-backport-39b1d75f branch January 30, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Port of a pull request already in a different code base integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants