From d6ce62ebc01eb483b486af886d9b79f60ff87de1 Mon Sep 17 00:00:00 2001 From: Thomas Obermeier Date: Thu, 2 Nov 2023 09:51:22 +0000 Subject: [PATCH] 8306561: Possible out of bounds access in print_pointer_information Reviewed-by: stuefe, clanger --- src/hotspot/share/nmt/mallocTracker.cpp | 3 ++- test/hotspot/jtreg/ProblemList.txt | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/nmt/mallocTracker.cpp b/src/hotspot/share/nmt/mallocTracker.cpp index 5c02226654c..3e7160d660c 100644 --- a/src/hotspot/share/nmt/mallocTracker.cpp +++ b/src/hotspot/share/nmt/mallocTracker.cpp @@ -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; } diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index fd4119d10c2..6bdbad4e796 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -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 #############################################################################