JDK-6930553 : classfile format checker allows invalid method descriptor in CONSTANT_NameAndType_info in some cases
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-02-27
  • Updated: 2013-04-10
  • Resolved: 2010-06-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u21pFixed 7Fixed hs19Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
JVMS section 4.4.6 states as follows:
  ---Excerpt-from-spec---
  CONSTANT_NameAndType_info {
    u1 tag;
    u2 name_index;
    u2 descriptor_index;
  }
  ...

  The items of the CONSTANT_NameAndType_info structure are as follows:
  ...
  descriptor_index

  The value of the descriptor_index item must be a valid index into the
  constant_pool table. The constant_pool entry at that index must be a
  CONSTANT_Utf8_info (4.4.7) structure representing a *valid* field descriptor
  (4.3.2) or method descriptor (4.3.3).
  ---End-of-excerpt---

However, JVM class format checker does not reject classes with invalid
(according to Section 4.3.3) method descriptors at the descriptor_index
in the CONSTANT_NameAndType_info structure (like "(#)V", "(.)V", "(;)V",
"()V#" or similar) if there are *NO any explicit or implicit references*
to this NameAndType from a class methods bytecodes.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/086d73ccd6c0
28-05-2010

EVALUATION Check NameAndType_info entries more aggressively for classfiles with version >= 51
24-05-2010