Skip to content

Commit

Permalink
8306561: Possible out of bounds access in print_pointer_information
Browse files Browse the repository at this point in the history
Reviewed-by: stuefe, clanger
  • Loading branch information
TOatGithub authored and MBaesken committed Nov 2, 2023
1 parent 7f31a05 commit d6ce62e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/hotspot/share/nmt/mallocTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ bool MallocTracker::print_pointer_information(const void* p, outputStream* st) {
const uint8_t* here = align_down(addr, smallest_possible_alignment);
const uint8_t* const end = here - (0x1000 + sizeof(MallocHeader)); // stop searching after 4k
for (; here >= end; here -= smallest_possible_alignment) {
if (!os::is_readable_pointer(here)) {
// JDK-8306561: cast to a MallocHeader needs to guarantee it can reside in readable memory
if (!os::is_readable_range(here, here + sizeof(MallocHeader) - 1)) {
// Probably OOB, give up
break;
}
Expand Down
3 changes: 0 additions & 3 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ serviceability/jvmti/stress/StackTrace/NotSuspended/GetStackTraceNotSuspendedStr

#############################################################################

gtest/GTestWrapper.java 8306561 aix-ppc64
gtest/NMTGtests.java#nmt-detail 8306561 aix-ppc64
gtest/NMTGtests.java#nmt-summary 8306561 aix-ppc64

#############################################################################

Expand Down

3 comments on commit d6ce62e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@RealCLanger
Copy link
Contributor

Choose a reason for hiding this comment

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

/backport jdk21u

@openjdk
Copy link

@openjdk openjdk bot commented on d6ce62e Nov 17, 2023

Choose a reason for hiding this comment

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

@RealCLanger the backport was successfully created on the branch RealCLanger-backport-d6ce62eb in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d6ce62eb from the openjdk/jdk repository.

The commit being backported was authored by Thomas Obermeier on 2 Nov 2023 and was reviewed by Thomas Stuefe and Christoph Langer.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u:

$ git fetch https://github.com/openjdk-bots/jdk21u.git RealCLanger-backport-d6ce62eb:RealCLanger-backport-d6ce62eb
$ git checkout RealCLanger-backport-d6ce62eb
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u.git RealCLanger-backport-d6ce62eb

Please sign in to comment.