-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8344365: SecurityManager cleanups in java.sql and java.sql.rowset modules #22185
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
|
👋 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 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
I think Brent and/or Lance have been working on this already. If you are taking this, can you remove src/java.sql.rowset/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java from the patch as it introduces a behavioural change that may require further work. |
Happy to yield if Brent/Lance has something cooking. Otherwise, perhaps their time is better spent as reviewers.
Seems like a clean inline, how does this introduce a behavioural change?
|
Class.forName's behavior depends on the caller's defining class loader. I don't know where Brent and/or Lance is on the changes for this module but if you are taking it then I would prefer if the changes to XmlReaderContentHandler were dropped. |
Thanks, makes sense. I have reverted changes in |
LanceAndersen
left a comment
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 for tackling this Eirik. I made a pass through and I think the changes are reasonable.
I have asked Sean to also make a pass as well
RogerRiggs
left a comment
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.
|
/reviewers 2 reviewer |
|
@eirbjo this pull request can not be integrated into git checkout sm-cleanup-sql
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@RogerRiggs |
# Conflicts: # test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java
|
Hey @RogerRiggs, I needed to merge with master to resolve a conflict after the integration of your PR #22041. Would you mind taking another look at the merge commit 3f1df59 and re-review this PR? While looking at your change in #22041, I noticed you removed CheckCSM runs fine with this method removed from If it was, I'm happy to remove it while I'm visiting this code anyhow, or you could clean it up via some other PR. Thanks :-) |
|
Yes, please cleanup the leftover mention, in CheckCSMs. of ObjectStreamField.getType(). |
…leftover from JDK-8344034
Thanks, see 0278c59. This leaves |
RogerRiggs
left a comment
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 good, thanks for the update.
|
Leave the test with an empty set of methods for CallerSensistiveAdepter will make it clearer to check for matching test conditions. |
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.
Your mailing list message recommends removal of this test. This test covers more than ensuring that CSMs are final or static; it actually scans all platform classes to ensure CSMs are present wherever they are needed.
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.
Sure, I'll leave the test with the empty set as suggested by Roger.
bchristi-git
left a comment
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 think the changes look fine.
|
I submitted an internal automated test run and it passes cleanly. |
|
/integrate |
|
Going to push as commit d85dd77.
Your commit was automatically rebased without conflicts. |
Please review this PR which cleans up SecurityManager-related code in
java.sqlandjava.sql.rowsetmodules post JEP-486There are quite a few changes to review, but all relatively straightforward:
DriverManagerSecurityManager::checkPermissioncalls in thesetLogWriter,setLogStreamandderegisterDrivermethodsensureDriversInitializedis updated to removeAccessController::doPrivilegedwhen reading a system property and when initializing driversCachedRowSetImplAccessController::doPrivilegedwhen getting aSyncFactoryinstancegetObjectis update to remove a call toReflectUtil::checkPackageAccessCachedRowSetWriterReflectUtil::checkPackageAccessis removed.SerialJavaObjectgetFieldsis updated to remove call toReflectUtil::checkPackageAccess.@CallerSensitiveis no longer needed for this method.CheckCSMs.javais updated to remove references toSerialJavaObject:getFieldsSyncFactoryinitMapIfNecessaryis updated to remove call toAccessController::doPrivilegedwhen reading system properties and when reading properties from an input streamgetInstanceis updated to remove calls toReflectUtil::checkPackageAccesssetLoggermethod is updated to remove call toSecurityManager::checkPermissionsetJNDIContextmethods are updated to remove call toSecurityManager::checkPermissionRowsetProviderSystem::getPropertydirectlynewFactoryis updated to callSystem::getPropertydirectlynewFactoryis updated to not callReflectUtil.checkPackageAccessgetContextClassLoaderis updated to not callAccessController::doPrivilegedgetFactoryClassis updated to not callReflectUtil.checkPackageAccessgetSystemPropertyis removedSQLInputImplReflectUtil::checkPackageAccessis removedTestPolicy.javaintest/java/sql/testng/utilRan
test/jdk/java/sqlandtest/jdk/javax/sqltests locally. GHA results pending.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22185/head:pull/22185$ git checkout pull/22185Update a local copy of the PR:
$ git checkout pull/22185$ git pull https://git.openjdk.org/jdk.git pull/22185/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22185View PR using the GUI difftool:
$ git pr show -t 22185Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22185.diff
Using Webrev
Link to Webrev Comment