> 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.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/34176/files
  - new: https://git.openjdk.org/jdk/pull/34176/files/84dbe4af..bf589980

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

  Stats: 4 lines in 2 files changed: 0 ins; 2 del; 2 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