Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8330174

Establish no-access zone at the start of Klass encoding range

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 23
    • hotspot
    • Fix Understood

      After having reserved an address range for the Klass encoding range, we either:
      a) Place CDS, then class space, into that address range
      b) Place only class space in that range (if CDS is off).

      If we wrongly decode an nKlass-id of 0, and the encoding base is not null, the resulting pointer points to the start of the class range. That area is readable, albeit unused (both CDS (a) and Metaspace (b) make sure that there is nothing placed).

      Therefore, it would be good to establish a no-access zone at the range's start and write protect it. Dereferencing such an nKlass would result in an immediate crash.

      This would closely mimic what we do in the compressed-oops-enabled java heap.

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: