-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8343981: Remove usage of security manager from Thread and related classes #22035
Conversation
Co-authored-by: Sean Mullan <[email protected]> Co-authored-by: Alan Bateman <[email protected]> Co-authored-by: Weijun Wang <[email protected]> Co-authored-by: Aleksei Efimov <[email protected]> Co-authored-by: Brian Burkhalter <[email protected]> Co-authored-by: Daniel Fuchs <[email protected]> Co-authored-by: Harshitha Onkar <[email protected]> Co-authored-by: Joe Wang <[email protected]> Co-authored-by: Jorn Vernee <[email protected]> Co-authored-by: Justin Lu <[email protected]> Co-authored-by: Kevin Walls <[email protected]>> Co-authored-by: Lance Andersen <[email protected]> Co-authored-by: Naoto Sato <[email protected]> Co-authored-by: Roger Riggs <[email protected]> Co-authored-by: Brent Christian <[email protected]>
…java, not useful without SM
setInitialContextFactoryBuilder and setObjectFactoryBuilder methods in javax.naming.spi.NamingManager.
permission cannot be used anymore to control access.
…sion checks of the Class.getNestHost and getNestMembers methods, which no longer apply.
…ested by other tests
…ava, useless without SM
ModuleDescriptor.location().
…attacker to create new instances
…Class<?> clazz, int which)
The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout JDK-8343981
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
@AlanBateman this pull request can not be integrated into git checkout JDK-8343981
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 |
|
The proposed changes look reasonable to me. Good simplification of the code. I had some uncertainty about the JNDI changes but I couldn't find any place in JNDI where a Subject would be extracted from the ACC associated with the created thread so I'd say that looks fine. |
ACC is dead and Subject is re-implemented on ScopedValue now so I think we are okay. There will be many other places where we will also drop the capture and use of the ACC. |
PrivilegedAction<Thread> act = | ||
() -> SharedSecrets.getJavaLangAccess().newThreadWithAcc(r, acc); | ||
return AccessController.doPrivileged(act); | ||
return new Thread(r); |
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.
Can the refactoring go back to the callers of createThread() to just create threads themselves.
And remove this trivial method.
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.
Yes, this will happen in the PR that does the cleanup of java.naming module.
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
|
/integrate |
Going to push as commit 5e01c40.
Your commit was automatically rebased without conflicts. |
@AlanBateman Pushed as commit 5e01c40. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Removes the SecurityManager usage from Thread + friends.
In Thread, the getContextClassLoader method is no longer caller-sensitive method.
JavaLangAccess.newThreadWithAcc is removed and jdk.internal.access is no longer exported to java.naming. The usage of newThreadWithAcc is removed from com.sun.jndi.ldap.VersionHelper. There will be further work on the java.naming module to remove usage of SM, the change here is specific to the usage of ewThreadWithAcc.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22035/head:pull/22035
$ git checkout pull/22035
Update a local copy of the PR:
$ git checkout pull/22035
$ git pull https://git.openjdk.org/jdk.git pull/22035/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22035
View PR using the GUI difftool:
$ git pr show -t 22035
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22035.diff
Using Webrev
Link to Webrev Comment