8306561: Possible out of bounds access in print_pointer_information

Reviewed-by: stuefe, clanger
This commit is contained in:
Thomas Obermeier 2023-11-02 09:51:22 +00:00 committed by Matthias Baesken
parent 7f31a0591c
commit d6ce62ebc0
2 changed files with 2 additions and 4 deletions

View File

@ -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;
}

View File

@ -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
#############################################################################