Bug 1080991 - Messages#getBundle() in jboss-logging is missing privileged action
Summary: Messages#getBundle() in jboss-logging is missing privileged action
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging
Version: 6.2.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: EAP 6.3.0
Assignee: James Perkins
QA Contact: Nikoleta Hlavickova
Russell Dickenson
URL:
Whiteboard:
Depends On: 1081196
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-26 12:56 UTC by Ivo Studensky
Modified: 2014-06-28 15:38 UTC (History)
5 users (show)

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.
Clone Of:
Environment:
Last Closed: 2014-06-28 15:38:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBLOGGING-102 0 Major Closed Messages#getBundle() needs to be privileged 2016-09-09 04:45:17 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.