Quantcast

RFR 8165753: Custom security manager, crashing wth 'java/security/AccessControlException'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RFR 8165753: Custom security manager, crashing wth 'java/security/AccessControlException'

vladimir kempik
Hello

Please review the fix for 8165753: Custom security manager, crashing wth
'java/security/AccessControlException'

Initially this bug came for jdk8, and it has reproducer for jdk8.

However this reproducer doesn't crash jdk9/10, but still needed there,
see explanation of this from David Holmes:

https://bugs.openjdk.java.net/browse/JDK-8165753?focusedCommentId=14001767&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14001767

The fix changes behaviour from a crash to a nice exception on jdk8, but
I need to get the fix into jdk10/9 first (jdk9/10 shows no visible
difference with testcase before/after patch)

Error occurred during initialization of VM
java.security.AccessControlException: access denied
("java.lang.RuntimePermission" "modifyThreadGroup")
     at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
     at
java.security.AccessController.checkPermission(AccessController.java:884)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
     at foo.TestSecurityManager.checkPermission(TestSecurityManager.java:48)
     at java.lang.SecurityManager.checkAccess(SecurityManager.java:729)
     at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
     at java.lang.Thread.init(Thread.java:391)
     at java.lang.Thread.init(Thread.java:349)
     at java.lang.Thread.<init>(Thread.java:532)


The bug: https://bugs.openjdk.java.net/browse/JDK-8165753

The Webrev: http://cr.openjdk.java.net/~vkempik/8165753/webrev.00/

Testing: jprt testset hotspot

Thanks, Vladimir

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR 8165753: Custom security manager, crashing wth 'java/security/AccessControlException'

David Holmes
Looks good to me Vladimir! Thanks for fixing.

David H.

On 13/02/2017 9:06 PM, Vladimir Kempik wrote:

> Hello
>
> Please review the fix for 8165753: Custom security manager, crashing wth
> 'java/security/AccessControlException'
>
> Initially this bug came for jdk8, and it has reproducer for jdk8.
>
> However this reproducer doesn't crash jdk9/10, but still needed there,
> see explanation of this from David Holmes:
>
> https://bugs.openjdk.java.net/browse/JDK-8165753?focusedCommentId=14001767&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14001767
>
>
> The fix changes behaviour from a crash to a nice exception on jdk8, but
> I need to get the fix into jdk10/9 first (jdk9/10 shows no visible
> difference with testcase before/after patch)
>
> Error occurred during initialization of VM
> java.security.AccessControlException: access denied
> ("java.lang.RuntimePermission" "modifyThreadGroup")
>     at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
>
>     at
> java.security.AccessController.checkPermission(AccessController.java:884)
>     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
>     at foo.TestSecurityManager.checkPermission(TestSecurityManager.java:48)
>     at java.lang.SecurityManager.checkAccess(SecurityManager.java:729)
>     at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
>     at java.lang.Thread.init(Thread.java:391)
>     at java.lang.Thread.init(Thread.java:349)
>     at java.lang.Thread.<init>(Thread.java:532)
>
>
> The bug: https://bugs.openjdk.java.net/browse/JDK-8165753
>
> The Webrev: http://cr.openjdk.java.net/~vkempik/8165753/webrev.00/
>
> Testing: jprt testset hotspot
>
> Thanks, Vladimir
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR 8165753: Custom security manager, crashing wth 'java/security/AccessControlException'

Daniel D. Daugherty
In reply to this post by vladimir kempik
 > The Webrev: http://cr.openjdk.java.net/~vkempik/8165753/webrev.00/

src/share/vm/runtime/os.hpp
     No comments.

src/share/vm/runtime/os.cpp
     No comments.

src/share/vm/runtime/thread.cpp
     CHECK_JNI_ERR is a new one on me. I was
     expecting CHECK_(JNI_ERR), but now I see
     that we have a short-cut...

 > The bug: https://bugs.openjdk.java.net/browse/JDK-8165753

I concur with David's analysis in the bug report that we
need to fix this in JDK9/JDK10 also because the code that
you guys identified in JDK8 is still wrong in JDK9/JDK10.

So while there is no difference with the reproducer on
JDK9 with or without the fix, we still need the fix.

Thumbs up!

Dan



On 2/13/17 4:06 AM, Vladimir Kempik wrote:

> Hello
>
> Please review the fix for 8165753: Custom security manager, crashing
> wth 'java/security/AccessControlException'
>
> Initially this bug came for jdk8, and it has reproducer for jdk8.
>
> However this reproducer doesn't crash jdk9/10, but still needed there,
> see explanation of this from David Holmes:
>
> https://bugs.openjdk.java.net/browse/JDK-8165753?focusedCommentId=14001767&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14001767 
>
>
> The fix changes behaviour from a crash to a nice exception on jdk8,
> but I need to get the fix into jdk10/9 first (jdk9/10 shows no visible
> difference with testcase before/after patch)
>
> Error occurred during initialization of VM
> java.security.AccessControlException: access denied
> ("java.lang.RuntimePermission" "modifyThreadGroup")
>     at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
>     at
> java.security.AccessController.checkPermission(AccessController.java:884)
>     at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
>     at
> foo.TestSecurityManager.checkPermission(TestSecurityManager.java:48)
>     at java.lang.SecurityManager.checkAccess(SecurityManager.java:729)
>     at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
>     at java.lang.Thread.init(Thread.java:391)
>     at java.lang.Thread.init(Thread.java:349)
>     at java.lang.Thread.<init>(Thread.java:532)
>
>
> The bug: https://bugs.openjdk.java.net/browse/JDK-8165753
>
> The Webrev: http://cr.openjdk.java.net/~vkempik/8165753/webrev.00/
>
> Testing: jprt testset hotspot
>
> Thanks, Vladimir
>
>

Loading...