Bug 1625678 - SELinux prevents remove_name for Tomcat
Summary: SELinux prevents remove_name for Tomcat
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.5
Hardware: Unspecified
OS: Linux
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
Depends On:
TreeView+ depends on / blocked
Reported: 2018-09-05 14:10 UTC by David Mulford
Modified: 2018-10-30 10:10 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:
Last Closed: 2018-10-30 10:09:41 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3111 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- 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.


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