On Thu, 3 Dec 2026 02:30:34 GMT, xiaotaonan <[email protected]> wrote:

>> The Classfile API verifier (`VerifierImpl`) currently skips methods marked 
>> with `ACC_BRIDGE` during verification. This is inconsistent with HotSpot's 
>> verifier, which only skips overpass methods (VM-generated) and still 
>> verifies ordinary bridge methods.
>> 
>> A maliciously crafted class file could therefore mark a method with 
>> `ACC_BRIDGE` to bypass verification entirely.
>> 
>> This fix aligns the Classfile API verifier with HotSpot by replacing the 
>> `isBridge()` check with an equivalent overpass check.
>> 
>> Testing:
>> - Added a regression test that constructs a class file with an invalid 
>> method body marked `ACC_BRIDGE`, and verifies that the Classfile API 
>> verifier now rejects it.
>> - Ran the existing `java/lang/classfile` and `jdk/internal/classfile` tests.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> xiaotaonan has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - fix: Modify according to the review comments.
>  - fix: Modify according to the review comments.

On a general note, it looks like in several of the PRs that you have currently 
proposed, the changes haven't been compiled locally nor the tests run locally. 
For example, the GitHub actions job of this PR shows compilation failures:


2026-12-03T06:07:31.0344886Z TEST: jdk/classfile/VerifierSelfTest.java
...
2026-12-03T06:07:31.3252488Z 
/home/runner/work/jdk/jdk/test/jdk/jdk/classfile/VerifierSelfTest.java:634: 
error: cannot find symbol
2026-12-03T06:07:31.3253319Z             cb.withMethod("<init>", 
MethodTypeDesc.of(ConstantDescs.CD_void), ClassFile.ACC_PUBLIC, mb -> {
2026-12-03T06:07:31.3254095Z                                                    
   ^
2026-12-03T06:07:31.3254482Z   symbol:   variable ConstantDescs
2026-12-03T06:07:31.3254818Z   location: class VerifierSelfTest
...
2026-12-03T06:07:31.3654328Z 4 errors
2026-12-03T06:07:31.3684387Z 9 warnings
2026-12-03T06:07:31.3694292Z 
2026-12-03T06:07:31.3714453Z TEST RESULT: Failed. Compilation failed: 
Compilation failed
...


Contributing fixes is fine, but please follow the general guidelines of 
contributing fixes 
https://openjdk.org/guide/#contributing-to-an-openjdk-project. That involves 
making sure you understand the change that is being proposed and have done the 
basic necessary testing before the reviewers spend time reviewing the change. 
Please avoid repeated back and forths to address trivial issues like 
compilation failures. If the change isn't ready, please put the PRs in draft 
state.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/34176#issuecomment-7371134565

Reply via email to