-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8344289: SM cleanup in jdk.internal.util #22141
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
…JEP486 integration
👋 Welcome back eirbjo! A progress list of the required criteria for merging this PR into |
@eirbjo This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 45 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few remarks; look fine otherwise. Pinging @rgiulietti to review the random generator changes.
@@ -134,48 +128,39 @@ public void dumpFailedClass(String name, byte[] bytes) { | |||
|
|||
@SuppressWarnings("removal") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this redundant suppression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, both fixed. IntelliJ IDEA keeps hiding these annotations, making them hard to spot.
path + " " + ex.getMessage()); | ||
} | ||
// simply don't care if this operation failed | ||
} | ||
} | ||
|
||
/* | ||
* Validate if the given dir is a writeable directory if exists. | ||
*/ | ||
@SuppressWarnings("removal") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same redundant suppression.
/reviewers 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -79,10 +77,6 @@ public static ClassFileDumper getInstance(String key, String path) { | |||
private final AtomicInteger counter = new AtomicInteger(); | |||
|
|||
private ClassFileDumper(String key, String path) { | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment might still be relevant if changed to System.getProperty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine now: previously user defined security manager was effectively loading user code that uses java.lang.invoke, now users cannot specify security managers, so this problem does not exist any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, the code should be calling System.getProperty and not the backup VM saved props.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liach Does this mean we can/should use System.getProperty
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VM saved props is still better imo as user code cannot tamper it with System.setProperty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of the properties in ClassFileDumper is all in support of debug capabilities and is not sensitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way is fine. I think we probably need to review the majority of uses of VM.savedPropoerty as they mostly relate to SM boot circularity. So we will change this one either now or later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if we could deal with getSavedProperty as a wider area follow up, since that would creep out of scope for this particular PR.
Ok with you, @liach ?
Perhaps @seanjmullan has input on how to deal with VM.getSavedProperty across the code base?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to minimize code changes for these cleanup issues. We should file a separate issue, "Examine usages of VM.getSavedProperty after JEP 486" or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sean, I filed https://bugs.openjdk.org/browse/JDK-8344335 to track this.
new sun.security.action.GetPropertyAction( | ||
"java.util.secureRandomSeed")); | ||
return (pp != null && pp.equalsIgnoreCase("true")); | ||
return Boolean.getBoolean("java.util.secureRandomSeed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why access to this system property required privileges.
It is documented in SplittableRandom, so I guess it's OK to have unprivileged access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, all properties were enabled only if allowed by the security policy.
Any property could be denied. Though it could/would cause havoc if used indiscriminately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
Thanks for the reviews and helpful discussions. I'll go ahead and integrate this pending a tier2 run. |
tier2 run completed with only /integrate |
Going to push as commit d0b770c.
Your commit was automatically rebased without conflicts. |
Please review this PR to clean up
RandomSupport
,ClassFileDumper
andStaticProperty
in thejdk.internal.util
namespace:RandomSupport
is updated to replace anAccessController::doPrivileged
call withBoolean::getBoolean
. (Existing code usesString::equalsIgnoreCase
, equivalent toBoolean::getBoolean
)ClassFileDumper
constructor is updated to remove a comment referencingGetPropertyAction
. (I left theVM::getSavedProperty
call as-is, please advise if this should be replaced with `System::getProperty)ClassFileDumper::write
is updated to unwrap aAccessController::doPrivileged
callStaticProperty
is updated to removeSecurityManager::checkPropertyAccess
references in the documentationVerification: GHA results pending.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22141/head:pull/22141
$ git checkout pull/22141
Update a local copy of the PR:
$ git checkout pull/22141
$ git pull https://git.openjdk.org/jdk.git pull/22141/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22141
View PR using the GUI difftool:
$ git pr show -t 22141
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22141.diff
Using Webrev
Link to Webrev Comment