> 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 one additional 
commit since the last revision:

  fix: Modify according to the review comments.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/34176/files
  - new: https://git.openjdk.org/jdk/pull/34176/files/5ca4f078..4dcba6be

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=34176&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=34176&range=00-01

  Stats: 24 lines in 1 file changed: 24 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/34176.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/34176/head:pull/34176

PR: https://git.openjdk.org/jdk/pull/34176

Reply via email to