RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1625678 - SELinux prevents remove_name for Tomcat
Summary: SELinux prevents remove_name for Tomcat
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.5
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-05 14:10 UTC by David Mulford
Modified: 2021-12-10 17:20 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-3.13.1-226.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:09:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3111 0 None None None 2018-10-30 10:10:52 UTC

Description David Mulford 2018-09-05 14:10:53 UTC
Description of problem:

SELinux denies remove_name when Tomcat attempts to delete a temporary file used when compiling class files for JSPs.

Here is an example of the AVC denial:

----
type=PROCTITLE msg=audit(09/04/2018 16:17:26.432:399533) : proctitle=/usr/lib/jvm/jre/bin/java 
type=SYSCALL msg=audit(09/04/2018 16:17:26.432:399533) : arch=x86_64 syscall=unlink success=no exit=-13(Permission denied) a0=0x7f1814763bb0 a1=0x7f17fc0016e8 a2=0x0 a3=0x2f70736a2f656863 items=0 ppid=1 pid=63959 auid=unset uid=unknown(53) gid=unknown(53) euid=unknown(53) suid=unknown(53) fsuid=unknown(53) egid=unknown(53) sgid=unknown(53) fsgid=unknown(53) tty=(none) ses=unset comm=java exe=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/bin/java subj=system_u:system_r:tomcat_t:s0 key=(null) 
type=AVC msg=audit(09/04/2018 16:17:26.432:399533) : avc:  denied  { remove_name } for  pid=63959 comm=java name=code_jsp.class dev="dm-3" ino=396278 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=dir

This manifests in the Tomcat logs as thrown exceptions and an http 500 response code.

ERROR [http-bio-8080-exec-8][VirtualHostFilter:361] org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:378)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
...

Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:672)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
... 205 more

Caused by: java.io.IOException: classFile.delete() failed
at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:201)
at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:163)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:491)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
... 206 more



Version-Release number of selected component (if applicable):

- RHEL 7.5 (kernel-3.10.0-862.9.1.el7.x86_64)
- tomcat-7.0.76-6.el7.noarch
- selinux-policy-3.13.1-192.el7_5.4.noarch
- selinux-policy-targeted-3.13.1-192.el7_5.4.noarch

Comment 14 errata-xmlrpc 2018-10-30 10:09:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3111


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