Bug 1080991

Summary: Messages#getBundle() in jboss-logging is missing privileged action
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ivo Studensky <istudens>
Component: LoggingAssignee: James Perkins <jperkins>
Status: CLOSED CURRENTRELEASE QA Contact: Nikoleta Hlavickova <nziakova>
Severity: unspecified Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.1CC: brian.stansberry, kkhan, myarboro, pkremens, smumford
Target Milestone: ER1   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In previous versions of JBoss EAP 6, running with a security manager enabled without sufficient permissions resulted in errors attempting to retrieve a message bundle. As a consequence, an exception presented when attempting to get a message bundle if class loader permissions were not enabled. In this release, retrieving message bundles is now done in a privilege block. The exceptions no longer occur when retrieving the message bundle when a security manager is enabled.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:38:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1081196    
Bug Blocks:    

Description Ivo Studensky 2014-03-26 12:56:40 UTC
Description of problem:
org.jboss.logging.Messages#getBundle(Class<T> type, Locale locale) calls type.getClassLoader which requires privileges when running with Security Manager, see the stack-trace below:

13:25:41,600 ERROR [stderr] (pool-1-thread-1) access: AccessControlContext invoking the Combiner
13:25:41,600 ERROR [stderr] (pool-1-thread-1) access: access allowed (java.io.FilePermission /content/mdb-read-props-deny.jar read)
13:25:41,601 ERROR [stderr] (pool-1-thread-1) access: access denied (java.lang.RuntimePermission getClassLoader)
13:25:41,601 ERROR [stderr] (pool-1-thread-1) java.lang.Exception: Stack trace
13:25:41,602 ERROR [stderr] (pool-1-thread-1) 	at java.lang.Thread.dumpStack(Thread.java:1249)
13:25:41,603 ERROR [stderr] (pool-1-thread-1) 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:364)
13:25:41,603 ERROR [stderr] (pool-1-thread-1) 	at java.security.AccessController.checkPermission(AccessController.java:549)
13:25:41,603 ERROR [stderr] (pool-1-thread-1) 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
13:25:41,604 ERROR [stderr] (pool-1-thread-1) 	at java.lang.Class.getClassLoader(Class.java:596)
13:25:41,604 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.logging.Messages.getBundle(Messages.java:66)
13:25:41,604 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.logging.Messages.getBundle(Messages.java:43)
13:25:41,604 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.<clinit>(SemaphoreArrayListManagedConnectionPool.java:76)
13:25:41,604 ERROR [stderr] (pool-1-thread-1) 	at java.lang.Class.forName0(Native Method)
13:25:41,605 ERROR [stderr] (pool-1-thread-1) 	at java.lang.Class.forName(Class.java:249)
13:25:41,605 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.pool.mcp.ManagedConnectionPoolFactory.<clinit>(ManagedConnectionPoolFactory.java:62)
13:25:41,605 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getManagedConnectionPool(AbstractPool.java:172)
13:25:41,605 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:357)
13:25:41,606 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)
13:25:41,606 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)
13:25:41,606 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)
13:25:41,606 ERROR [stderr] (pool-1-thread-1) 	at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:832)
13:25:41,607 ERROR [stderr] (pool-1-thread-1) 	at org.hornetq.ra.HornetQRASessionFactoryImpl.createQueueSession(HornetQRASessionFactoryImpl.java:232)
13:25:41,607 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.as.testsuite.integration.secman.AbstractMDBPermissionPropertyReadTestCase.sendMessage(AbstractMDBPermissionPropertyReadTestCase.java:107)
13:25:41,607 ERROR [stderr] (pool-1-thread-1) 	at org.jboss.as.testsuite.integration.secman.MDBDenyPermissionPropertyReadTestCase.testJavaHomePropertyDeny(MDBDenyPermissionPropertyReadTestCase.java:47)




Version-Release number of selected component (if applicable):
jboss-logging-3.1.4.GA

Comment 1 JBoss JIRA Server 2014-03-26 17:36:37 UTC
James Perkins <jperkins> updated the status of jira JBLOGGING-102 to Closed

Comment 2 Kabir Khan 2014-03-26 22:35:47 UTC
https://github.com/jbossas/jboss-eap/pull/1143

Comment 3 Petr Kremensky 2014-04-23 12:59:32 UTC
Verified on EAP 6.3.0.ER2.