Skip to content

Prevent non-root accessible objects from poisoning the cache #22247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

chrisdennis
Copy link
Contributor

@chrisdennis chrisdennis commented Jul 17, 2025

Enabling the reflect cache debugging logic you can see there are numerous paths that can poison the reflection caches with non-root reflection objects. Rather than attempt to unravel all the possible paths in to this point I figured it would be easier to just extract the root instances and move on.

I'm not 100% on the preprocessor logic in use here, and whether this code is going to tolerate all the different possible target JDK version? I assume/hope that there's enough CI coverage to prove if this needs more work/polish.

Fixes #14143

@chrisdennis
Copy link
Contributor Author

FYI: I'm currently pounding on this locally using the reproducer seen in #22240.

@pshipton pshipton requested a review from keithc-ca July 17, 2025 18:55
@keithc-ca
Copy link
Contributor

Please remove the prefix "Fixes #14143 : " from the commit summary line (it should be no more than 70 characters long). The reference to that issue should go in the body of the commit message. Please also update the title of this pull request similarly.

@chrisdennis chrisdennis force-pushed the issue-14143-reflection-cache-poisoning branch from 593cec8 to e662bc1 Compare July 17, 2025 19:53
@chrisdennis chrisdennis changed the title Fixes #14143 : Prevent non-root accessible object references from poisoning the cache Prevent non-root accessible objects from poisoning the cache Jul 17, 2025
@chrisdennis chrisdennis force-pushed the issue-14143-reflection-cache-poisoning branch 2 times, most recently from 17d34e6 to 6ecbc6c Compare July 18, 2025 17:59
@chrisdennis chrisdennis requested a review from keithc-ca July 18, 2025 18:09
@chrisdennis chrisdennis force-pushed the issue-14143-reflection-cache-poisoning branch from 6ecbc6c to d8a1d57 Compare July 18, 2025 20:00
@chrisdennis chrisdennis requested a review from keithc-ca July 18, 2025 20:01
@chrisdennis chrisdennis force-pushed the issue-14143-reflection-cache-poisoning branch from d8a1d57 to fee88ea Compare July 18, 2025 20:32
@chrisdennis chrisdennis requested a review from keithc-ca July 18, 2025 20:32
Fixes eclipse-openj9#14143 by preventing non-root accessible objects from entering the
reflection caches. Allowing non-root objects in the caches will trigger
failures when those objects are copied before being returned from public
accessor methods.

Signed-off-by: Chris Dennis <[email protected]>
@chrisdennis chrisdennis force-pushed the issue-14143-reflection-cache-poisoning branch from fee88ea to ab6a8ce Compare July 18, 2025 21:32
@keithc-ca
Copy link
Contributor

Jenkins test sanity plinux jdk8,jdk11,jdk21

@keithc-ca keithc-ca merged commit 36f7bf0 into eclipse-openj9:master Jul 21, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JDK8 Mauve[gnu.testlet.java.beans.PropertyDescriptor.constructorTest2] - IllegalArgumentException: Can not copy a non-root Method
3 participants