jdk
jdk copied to clipboard
8338411: Implement JEP 486: Permanently Disable the Security Manager
This is the implementation of JEP 486: Permanently Disable the Security Manager. See JEP 486 for more details. The CSR describes in detail the main changes in the JEP and also includes an apidiff of the specification changes.
NOTE: the majority (~95%) of the changes in this PR are test updates (removal/modifications) and API specification changes, the latter mostly to remove @throws SecurityException
. The remaining changes are primarily the removal of the SecurityManager
, Policy
, AccessController
and other Security Manager API implementations. There is very little new code.
The code changes can be broken down into roughly the following categories:
- Degrading the behavior of Security Manager APIs to either throw Exceptions by default or provide an execution environment that disallows access to all resources by default.
- Changing hundreds of methods and constructors to no longer throw a
SecurityException
if a Security Manager was enabled. They will operate as they did in JDK 23 with no Security Manager enabled. - Changing the
java
command to exit with a fatal error if a Security Manager is enabled. - Removing the hotspot native code for the privileged stack walk and the inherited access control context. The remaining hotspot code and tests related to the Security Manager will be removed immediately after integration - see JDK-8341916.
- Removing or modifying hundreds of tests. Many tests that tested Security Manager behavior are no longer relevant and thus have been removed or modified.
There are a handful of Security Manager related tests that are failing and are at the end of the test/jdk/ProblemList.txt
, test/langtools/ProblemList.txt
and test/hotspot/jtreg/ProblemList.txt
files - these will be removed or separate bugs will be filed before integrating this PR.
Inside the JDK, we have retained calls to SecurityManager::getSecurityManager
and AccessController::doPrivileged
for now, as these methods have been degraded to behave the same as they did in JDK 23 with no Security Manager enabled. After we integrate this JEP, those calls will be removed in each area (client-libs, core-libs, security, etc).
I don't expect each reviewer to review all the code changes in this JEP. Rather, I advise that you only focus on the changes for the area (client-libs, core-libs, net, security, etc) that you are most familiar with.
Progress
- [x] Change must not contain extraneous whitespace
- [ ] Change requires CSR request JDK-8338412 to be approved
- [x] Commit message must refer to an issue
- [ ] Change requires a JEP request to be targeted
- [ ] Change must be properly reviewed (3 reviews required, with at least 1 Reviewer, 2 Authors)
Error
⚠️ 8338411 is used in problem lists: [test/hotspot/jtreg/ProblemList.txt, test/jdk/ProblemList.txt, test/langtools/ProblemList.txt]
Issues
- JDK-8338411: Implement JEP 486: Permanently Disable the Security Manager (Enhancement - P3)
- JDK-8338625: JEP 486: Permanently Disable the Security Manager (JEP)
- JDK-8338412: Implement JEP 486: Permanently Disable the Security Manager (CSR)
Reviewers
- Daniel Fuchs (@dfuch - Reviewer)
- Magnus Ihse Bursie (@magicus - Reviewer) 🔄 Re-review required (review applies to d05122fb)
- Erik Joelsson (@erikj79 - Reviewer) 🔄 Re-review required (review applies to d05122fb)
- Chris Plummer (@plummercj - Reviewer) 🔄 Re-review required (review applies to d05122fb)
- Coleen Phillimore (@coleenp - Reviewer) 🔄 Re-review required (review applies to d05122fb)
- Naoto Sato (@naotoj - Reviewer) 🔄 Re-review required (review applies to d05122fb)
- Joe Wang (@JoeWang-Java - Reviewer) 🔄 Re-review required (review applies to d05122fb)
- @dmlloyd (no known openjdk.org user name / role)
- Kevin Walls (@kevinjwalls - Reviewer)
Contributors
- Sean Mullan
<[email protected]>
- Alan Bateman
<[email protected]>
- Weijun Wang
<[email protected]>
- Aleksei Efimov
<[email protected]>
- Brian Burkhalter
<[email protected]>
- Daniel Fuchs
<[email protected]>
- Harshitha Onkar
<[email protected]>
- Joe Wang
<[email protected]>
- Jorn Vernee
<[email protected]>
- Justin Lu
<[email protected]>
- Kevin Walls
<[email protected]>
- Lance Andersen
<[email protected]>
- Naoto Sato
<[email protected]>
- Roger Riggs
<[email protected]>
- Brent Christian
<[email protected]>
- Stuart Marks
<[email protected]>
- Ian Graves
<[email protected]>
- Phil Race
<[email protected]>
- Erik Gahlin
<[email protected]>
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21498/head:pull/21498
$ git checkout pull/21498
Update a local copy of the PR:
$ git checkout pull/21498
$ git pull https://git.openjdk.org/jdk.git pull/21498/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21498
View PR using the GUI difftool:
$ git pr show -t 21498
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21498.diff