Bug 1801214
| Summary: | SELinux prevents pdns_server from mmap()-ing the /usr/share/p11-kit/modules/p11-kit-trust.module file | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Milos Malik <mmalik> |
| Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> |
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.2 | CC: | lvrabec, mmalik, ms, plautrba, ssekidde |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.3 | Flags: | pm-rhel:
mirror+
|
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-11-04 01:56:01 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: | |||
Actual results (permissive mode):
----
type=PROCTITLE msg=audit(02/10/2020 07:59:29.990:508) : proctitle=/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no
type=MMAP msg=audit(02/10/2020 07:59:29.990:508) : fd=6 flags=MAP_PRIVATE
type=SYSCALL msg=audit(02/10/2020 07:59:29.990:508) : arch=x86_64 syscall=mmap success=yes exit=140636530028544 a0=0x0 a1=0x308 a2=PROT_READ a3=MAP_PRIVATE items=0 ppid=1 pid=20006 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=pdns_server exe=/usr/sbin/pdns_server subj=system_u:system_r:pdns_t:s0 key=(null)
type=AVC msg=audit(02/10/2020 07:59:29.990:508) : avc: denied { map } for pid=20006 comm=pdns_server path=/usr/share/p11-kit/modules/p11-kit-trust.module dev="vda1" ino=4253781 scontext=system_u:system_r:pdns_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=file permissive=1
----
I've submitted a Fedora PR to address the issue generally: https://github.com/fedora-selinux/selinux-policy/pull/371 If accepted, we can close these similar bzs as duplicates: https://bugzilla.redhat.com/show_bug.cgi?id=1801183 https://bugzilla.redhat.com/show_bug.cgi?id=1822532 unless it makes confusion in test cases. *** Bug 1801183 has been marked as a duplicate of this bug. *** *** Bug 1822532 has been marked as a duplicate of this bug. *** Hi,
During testing it turned out pdns_server in the ctrlListen thread requests access to /proc/stat. Is it expected and should we allow it in the policy, or can it be dontaudited (do not allow, do not audit)?
----
type=PROCTITLE msg=audit(06/16/2020 09:32:00.585:154) : proctitle=/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no
type=PATH msg=audit(06/16/2020 09:32:00.585:154) : item=0 name=/proc/stat inode=4026531911 dev=00:04 mode=file,444 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:proc_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(06/16/2020 09:32:00.585:154) : cwd=/
type=SYSCALL msg=audit(06/16/2020 09:32:00.585:154) : arch=ppc64le syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffffffffffff9c a1=0x10113aed8 a2=O_RDONLY a3=0x0 items=1 ppid=1 pid=30735 auid=unset uid=pdns gid=pdns euid=pdns suid=pdns fsuid=pdns egid=pdns sgid=pdns fsgid=pdns tty=(none) ses=unset comm=pdns/ctrlListen exe=/usr/sbin/pdns_server subj=system_u:system_r:pdns_t:s0 key=(null)
type=AVC msg=audit(06/16/2020 09:32:00.585:154) : avc: denied { read } for pid=30735 comm=pdns/ctrlListen name=stat dev="proc" ino=4026531911 scontext=system_u:system_r:pdns_t:s0 tcontext=system_u:object_r:proc_t:s0 tclass=file permissive=0
----
I am not sure I am the right person for the needinfo. Not sure how I am involved in this. Adrian, I am sorry for bothering you, got your name from packaging information. Anyway, moving further: https://github.com/fedora-selinux/selinux-policy-contrib/pull/281 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 (selinux-policy bug fix and enhancement update), 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-2020:4528 |
Description of problem: Version-Release number of selected component (if applicable): pdns-4.2.1-1.el8.x86_64 (comes from EPEL) selinux-policy-3.14.3-38.el8.noarch selinux-policy-devel-3.14.3-38.el8.noarch selinux-policy-targeted-3.14.3-38.el8.noarch How reproducible: * always Steps to Reproduce: 1. get a RHEL-8.2 machine (targeted policy is active) 2. run following automated TCs: * /CoreOS/selinux-policy/Regression/pdns_server-and-similar 3. search for SELinux denials Actual results (enforcing mode): ---- type=PROCTITLE msg=audit(02/10/2020 07:33:00.081:491) : proctitle=/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no type=MMAP msg=audit(02/10/2020 07:33:00.081:491) : fd=6 flags=MAP_PRIVATE type=SYSCALL msg=audit(02/10/2020 07:33:00.081:491) : arch=x86_64 syscall=mmap success=no exit=EACCES(Permission denied) a0=0x0 a1=0x308 a2=PROT_READ a3=MAP_PRIVATE items=0 ppid=1 pid=13698 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=pdns_server exe=/usr/sbin/pdns_server subj=system_u:system_r:pdns_t:s0 key=(null) type=AVC msg=audit(02/10/2020 07:33:00.081:491) : avc: denied { map } for pid=13698 comm=pdns_server path=/usr/share/p11-kit/modules/p11-kit-trust.module dev="vda1" ino=4253781 scontext=system_u:system_r:pdns_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=file permissive=0 ---- Expected results: * no SELinux denials Additional info: # getsebool -a | grep mmap domain_can_mmap_files --> off mmap_low_allowed --> off wine_mmap_zero_ignore --> off #