Bug 1601151
| Summary: | SELinux prevents /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java from searching under /sys/fs/cgroup/ directory | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Lukas Slebodnik <lslebodn> |
| Component: | selinux-policy | Assignee: | Lukas Vrabec <lvrabec> |
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.6 | CC: | adam.kosseck, lvrabec, mgrepl, mmalik, pasik, plautrba, ssekidde |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-30 10:07:41 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: | |||
And 3 reports using permissive mode:
SELinux is preventing /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java from search access on the directory /sys/fs/cgroup/memory/memory.limit_in_bytes.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that java should be allowed search access on the memory.limit_in_bytes directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'java' --raw | audit2allow -M my-java
# semodule -i my-java.pp
Additional Information:
Source Context system_u:system_r:tomcat_t:s0
Target Context system_u:object_r:cgroup_t:s0
Target Objects /sys/fs/cgroup/memory/memory.limit_in_bytes [ dir
]
Source java
Source Path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el
7.x86_64/jre/bin/java
Port <Unknown>
Host host.example.com
Source RPM Packages java-1.8.0-openjdk-
headless-1.8.0.181-6.b04.el7.x86_64
Target RPM Packages
Policy RPM selinux-policy-3.13.1-207.el7.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name host.testrelm.test
Platform Linux host.testrelm.test
3.10.0-919.el7.x86_64 #1 SMP Wed Jul 4 10:42:36
EDT 2018 x86_64 x86_64
Alert Count 11
First Seen 2018-07-14 06:23:25 EDT
Last Seen 2018-07-14 06:27:28 EDT
Local ID 2b98728f-d4b8-4f6a-94d2-7a6d871a1595
Raw Audit Messages
type=AVC msg=audit(1531564048.10:538): avc: denied { search } for pid=24922 comm="java" name="/" dev="tmpfs" ino=2227 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1531564048.10:538): avc: denied { read } for pid=24922 comm="java" name="memory.limit_in_bytes" dev="cgroup" ino=2291 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
type=AVC msg=audit(1531564048.10:538): avc: denied { open } for pid=24922 comm="java" path="/sys/fs/cgroup/memory/memory.limit_in_bytes" dev="cgroup" ino=2291 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
type=SYSCALL msg=audit(1531564048.10:538): arch=x86_64 syscall=open success=yes exit=ESRCH a0=7f56edf29950 a1=0 a2=1b6 a3=24 items=1 ppid=1 pid=24922 auid=4294967295 uid=17 gid=17 euid=17 suid=17 fsuid=17 egid=17 sgid=17 fsgid=17 tty=(none) ses=4294967295 comm=java exe=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java subj=system_u:system_r:tomcat_t:s0 key=(null)
type=CWD msg=audit(1531564048.10:538): cwd=/usr/share/tomcat
type=PATH msg=audit(1531564048.10:538): item=0 name=/sys/fs/cgroup/memory/memory.limit_in_bytes inode=2291 dev=00:1a mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:cgroup_t:s0 objtype=NORMAL cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
Hash: java,tomcat_t,cgroup_t,dir,search
SELinux is preventing /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java from getattr access on the file /sys/fs/cgroup/memory/memory.limit_in_bytes.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that java should be allowed getattr access on the memory.limit_in_bytes file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'java' --raw | audit2allow -M my-java
# semodule -i my-java.pp
Additional Information:
Source Context system_u:system_r:tomcat_t:s0
Target Context system_u:object_r:cgroup_t:s0
Target Objects /sys/fs/cgroup/memory/memory.limit_in_bytes [ file
]
Source java
Source Path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el
7.x86_64/jre/bin/java
Port <Unknown>
Host host.example.com
Source RPM Packages java-1.8.0-openjdk-
headless-1.8.0.181-6.b04.el7.x86_64
Target RPM Packages
Policy RPM selinux-policy-3.13.1-207.el7.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name host.testrelm.test
Platform Linux host.testrelm.test
3.10.0-919.el7.x86_64 #1 SMP Wed Jul 4 10:42:36
EDT 2018 x86_64 x86_64
Alert Count 11
First Seen 2018-07-14 06:23:25 EDT
Last Seen 2018-07-14 06:27:28 EDT
Local ID 6f90c951-fbf9-4108-b217-334b1e9c7e45
Raw Audit Messages
type=AVC msg=audit(1531564048.11:539): avc: denied { getattr } for pid=24922 comm="java" path="/sys/fs/cgroup/memory/memory.limit_in_bytes" dev="cgroup" ino=2291 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
type=SYSCALL msg=audit(1531564048.11:539): arch=x86_64 syscall=fstat success=yes exit=0 a0=3 a1=7f56edf297a0 a2=7f56edf297a0 a3=0 items=0 ppid=1 pid=24922 auid=4294967295 uid=17 gid=17 euid=17 suid=17 fsuid=17 egid=17 sgid=17 fsgid=17 tty=(none) ses=4294967295 comm=java exe=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java subj=system_u:system_r:tomcat_t:s0 key=(null)
Hash: java,tomcat_t,cgroup_t,file,getattr
SELinux is preventing /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java from read access on the file /sys/fs/cgroup/memory/memory.limit_in_bytes.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that java should be allowed read access on the memory.limit_in_bytes file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'java' --raw | audit2allow -M my-java
# semodule -i my-java.pp
Additional Information:
Source Context system_u:system_r:tomcat_t:s0
Target Context system_u:object_r:cgroup_t:s0
Target Objects /sys/fs/cgroup/memory/memory.limit_in_bytes [ file
]
Source java
Source Path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el
7.x86_64/jre/bin/java
Port <Unknown>
Host host.example.com
Source RPM Packages java-1.8.0-openjdk-
headless-1.8.0.181-6.b04.el7.x86_64
Target RPM Packages
Policy RPM selinux-policy-3.13.1-207.el7.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name host.testrelm.test
Platform Linux host.testrelm.test
3.10.0-919.el7.x86_64 #1 SMP Wed Jul 4 10:42:36
EDT 2018 x86_64 x86_64
Alert Count 1
First Seen 2018-07-14 06:24:33 EDT
Last Seen 2018-07-14 06:24:33 EDT
Local ID 55239715-cbc2-422d-a675-158068e7d2c1
Raw Audit Messages
type=AVC msg=audit(1531563873.269:444): avc: denied { read } for pid=20666 comm="java" name="memory.limit_in_bytes" dev="cgroup" ino=2291 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
type=AVC msg=audit(1531563873.269:444): avc: denied { open } for pid=20666 comm="java" path="/sys/fs/cgroup/memory/memory.limit_in_bytes" dev="cgroup" ino=2291 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
type=SYSCALL msg=audit(1531563873.269:444): arch=x86_64 syscall=open success=yes exit=ESRCH a0=7f372f948950 a1=0 a2=1b6 a3=24 items=1 ppid=1 pid=20666 auid=4294967295 uid=17 gid=17 euid=17 suid=17 fsuid=17 egid=17 sgid=17 fsgid=17 tty=(none) ses=4294967295 comm=java exe=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java subj=system_u:system_r:tomcat_t:s0 key=(null)
type=CWD msg=audit(1531563873.269:444): cwd=/usr/share/tomcat
type=PATH msg=audit(1531563873.269:444): item=0 name=/sys/fs/cgroup/memory/memory.limit_in_bytes inode=2291 dev=00:1a mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:cgroup_t:s0 objtype=NORMAL cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
Hash: java,tomcat_t,cgroup_t,file,read
I could not see AVCs with java-1.8.0-openjdk-1.8.0.181-4.b04.el7.x86_64 Issue replicated with java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64 after it was installed as part of a Satellite 6.3.3 Puppet 4 upgrade. 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 |
SELinux is preventing /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java from search access on the directory /sys/fs/cgroup/cpu,cpuacct/cpu.shares. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that java should be allowed search access on the cpu.shares directory by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # ausearch -c 'java' --raw | audit2allow -M my-java # semodule -i my-java.pp Additional Information: Source Context system_u:system_r:tomcat_t:s0 Target Context system_u:object_r:cgroup_t:s0 Target Objects /sys/fs/cgroup/cpu,cpuacct/cpu.shares [ dir ] Source java Source Path /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el 7.x86_64/jre/bin/java Port <Unknown> Host host.example.com Source RPM Packages java-1.8.0-openjdk- headless-1.8.0.181-6.b04.el7.x86_64 Target RPM Packages Policy RPM selinux-policy-3.13.1-207.el7.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name xci29.testrelm.test Platform Linux xci29.testrelm.test 3.10.0-919.el7.x86_64 #1 SMP Wed Jul 4 10:42:36 EDT 2018 x86_64 x86_64 Alert Count 55 First Seen 2018-07-14 06:22:07 EDT Last Seen 2018-07-14 06:26:00 EDT Local ID dff2e655-936d-4ee6-8eca-e56616bf68aa Raw Audit Messages type=AVC msg=audit(1531563960.614:726): avc: denied { search } for pid=25638 comm="java" name="/" dev="tmpfs" ino=2244 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=dir permissive=0 type=SYSCALL msg=audit(1531563960.614:726): arch=x86_64 syscall=open success=no exit=EACCES a0=7fd2784d4150 a1=0 a2=1b6 a3=24 items=1 ppid=1 pid=25638 auid=4294967295 uid=17 gid=17 euid=17 suid=17 fsuid=17 egid=17 sgid=17 fsgid=17 tty=(none) ses=4294967295 comm=java exe=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-6.b04.el7.x86_64/jre/bin/java subj=system_u:system_r:tomcat_t:s0 key=(null) type=CWD msg=audit(1531563960.614:726): cwd=/usr/share/tomcat type=PATH msg=audit(1531563960.614:726): item=0 name=/sys/fs/cgroup/cpu,cpuacct/cpu.shares objtype=UNKNOWN cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0 Hash: java,tomcat_t,cgroup_t,dir,search