Skip to content

8382166: [AOT Cache] CRC was not checked on Code Region#30720

Draft
Delawen wants to merge 1 commit intoopenjdk:masterfrom
Delawen:check-crc-in-code-region
Draft

8382166: [AOT Cache] CRC was not checked on Code Region#30720
Delawen wants to merge 1 commit intoopenjdk:masterfrom
Delawen:check-crc-in-code-region

Conversation

@Delawen
Copy link
Copy Markdown
Member

@Delawen Delawen commented Apr 14, 2026

Fixes: https://bugs.openjdk.org/browse/JDK-8382166

While other regions check the CRC when loading the cache[1], the code cache region does not check it[2].

This may bring issues with corrupted (or tainted) caches that load corrupted (or malicious) code into memory.

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/cds/filemap.cpp#L1319-L1323 or https://github.com/openjdk/jdk/blob/master/src/hotspot/share/cds/filemap.cpp#L1285-L1286
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/cds/filemap.cpp#L1338-L1372

On this PR, we add a CRC check that cleans up memory if it fails. The code is inspired on https://github.com/openjdk/jdk/blob/master/src/hotspot/share/cds/filemap.cpp#L1319-L1323



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8382166: [AOT Cache] CRC was not checked on Code Region (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30720/head:pull/30720
$ git checkout pull/30720

Update a local copy of the PR:
$ git checkout pull/30720
$ git pull https://git.openjdk.org/jdk.git pull/30720/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30720

View PR using the GUI difftool:
$ git pr show -t 30720

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30720.diff

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 14, 2026

👋 Welcome back mariasde! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 14, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8382166 [AOT Cache] CRC was not checked on Code Region 8382166: [AOT Cache] CRC was not checked on Code Region Apr 14, 2026
@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Apr 14, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 14, 2026

@Delawen The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant