Skip to content

Commit d6ce62e

Browse files
TOatGithubMBaesken
authored andcommitted
8306561: Possible out of bounds access in print_pointer_information
Reviewed-by: stuefe, clanger
1 parent 7f31a05 commit d6ce62e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/hotspot/share/nmt/mallocTracker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ bool MallocTracker::print_pointer_information(const void* p, outputStream* st) {
211211
const uint8_t* here = align_down(addr, smallest_possible_alignment);
212212
const uint8_t* const end = here - (0x1000 + sizeof(MallocHeader)); // stop searching after 4k
213213
for (; here >= end; here -= smallest_possible_alignment) {
214-
if (!os::is_readable_pointer(here)) {
214+
// JDK-8306561: cast to a MallocHeader needs to guarantee it can reside in readable memory
215+
if (!os::is_readable_range(here, here + sizeof(MallocHeader) - 1)) {
215216
// Probably OOB, give up
216217
break;
217218
}

test/hotspot/jtreg/ProblemList.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ serviceability/jvmti/stress/StackTrace/NotSuspended/GetStackTraceNotSuspendedStr
144144

145145
#############################################################################
146146

147-
gtest/GTestWrapper.java 8306561 aix-ppc64
148-
gtest/NMTGtests.java#nmt-detail 8306561 aix-ppc64
149-
gtest/NMTGtests.java#nmt-summary 8306561 aix-ppc64
150147

151148
#############################################################################
152149

0 commit comments

Comments
 (0)