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

lossy narrowing cast of JVMCINMethodData::size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 25
    • hotspot

      In JDK-8343789, the 32-bit int value returned by JVMCINMethodData::size was cast to a uint_16. This value is used to compute the offset of the JVMCINMethodData chunk in CodeBlob::_mutable_data. The allocation of memory for CodeBlob::_mutable_data on the other hand, uses JVMCINMethodData::size without any casting. This inconsistency results in memory being written out of bounds in the case where a very long name is attached to JVMCI installed code (see JDK-8355034).

      I think the right fix is to revert nmethod::_jvmci_data_size back to an int.

            bulasevich Boris Ulasevich
            dnsimon Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: