United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6942326 x86 code in string_indexof() could read beyond reserved heap space
6942326 : x86 code in string_indexof() could read beyond reserved heap space

Details
Type:
Bug
Submit Date:
2010-04-08
Status:
Closed
Updated Date:
2011-09-22
Project Name:
JDK
Resolved Date:
2011-04-24
Component:
hotspot
OS:
solaris_10
Sub-Component:
compiler
CPU:
sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs18
Fixed Versions:
hs21

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
MacroAssembler::string_indexof() code loads 16 bytes into XMM registers regardless where char[] array ends and as result it can read beyond reserver heap space causing SEGV.

                                    

Comments
PUBLIC COMMENTS

MacroAssembler::string_indexof() code loads 16 bytes into XMM
registers regardless where char[] array ends and as result
it can read beyond reserved heap space causing SEGV.

I divided code in string_indexof() into two parts:

1. For constant substrings with size >=8 elements. This part doesn't need
special handling strings loading and it doesn't modify strings pointers so no need to push them on stack.

2. For constant substrings with size <8 elements or non constant substring
(size is unknown). This part has special handling for strings loading:
if size is small and it cross page boundary copy string to stack and load from it. If substring is constant use separate mov instructions to load it. This part also do additional checks for small tails during search and back up pointers to load them.
                                     
2011-02-28
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/41d4973cf100
                                     
2011-02-26



Hardware and Software, Engineered to Work Together