Skip to content

Commit 177d994

Browse files
committed
8306561: Possible out of bounds access in print_pointer_information
8319542: Fix boundaries of region to be tested with os::is_readable_range Reviewed-by: mbaesken Backport-of: d6ce62ebc01eb483b486af886d9b79f60ff87de1
1 parent a9f71e9 commit 177d994

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/hotspot/share/services/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))) {
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
@@ -137,9 +137,6 @@ serviceability/attach/ConcAttachTest.java 8290043 linux-all
137137

138138
#############################################################################
139139

140-
gtest/GTestWrapper.java 8306561 aix-ppc64
141-
gtest/NMTGtests.java#nmt-detail 8306561 aix-ppc64
142-
gtest/NMTGtests.java#nmt-summary 8306561 aix-ppc64
143140

144141
#############################################################################
145142

0 commit comments

Comments
 (0)