Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8269034

AccessControlException for SunPKCS11 daemon threads

    XMLWordPrintable

    Details

      Backports

        Description

        New resource cleaner thread introduced via JDK-8240256 is lacking sufficient privilege when security manager is present.

        Exception in thread "main" java.security.ProviderException: Initialization failed
                at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:386)
                at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:117)
                at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:114)
                at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
                at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:114)
                at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:257)
                at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:248)
                at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
                at java.base/sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:248)
                at java.base/sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:226)
                at java.base/sun.security.jca.ProviderList.loadAll(ProviderList.java:317)
                at java.base/sun.security.jca.ProviderList.removeInvalid(ProviderList.java:334)
                at java.base/sun.security.jca.Providers.getFullProviderList(Providers.java:175)
                at java.base/java.security.Security.getProviders(Security.java:458)
                at DefaultPKCS11.main(DefaultPKCS11.java:13)
        Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "setContextClassLoader")
                at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:485)
                at java.base/java.security.AccessController.checkPermission(AccessController.java:1068)
                at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:416)
                at java.base/java.lang.Thread.setContextClassLoader(Thread.java:1525)
                at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$NativeResourceCleaner.<init>(SunPKCS11.java:982)
                at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.initToken(SunPKCS11.java:1193)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                coffeys Sean Coffey
                Reporter:
                coffeys Sean Coffey
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: