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
8319542: Fix boundaries of region to be tested with os::is_readable_range

Reviewed-by: mbaesken
Backport-of: d6ce62ebc01eb483b486af886d9b79f60ff87de1
  • Loading branch information
RealCLanger committed Nov 21, 2023
1 parent a9f71e9 commit 177d994
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/services/mallocTracker.cpp
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))) {
// Probably OOB, give up
break;
}
Expand Down
3 changes: 0 additions & 3 deletions test/hotspot/jtreg/ProblemList.txt
Expand Up @@ -137,9 +137,6 @@ serviceability/attach/ConcAttachTest.java 8290043 linux-all

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

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

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

Expand Down

1 comment on commit 177d994

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.