Description of problem: # journalctl -l -u collectd | grep -i denied May 24 07:09:11 removed collectd[4592]: interface plugin: fopen: Permission denied May 24 07:09:31 removed collectd[4592]: interface plugin: fopen: Permission denied May 24 07:10:11 removed collectd[4592]: interface plugin: fopen: Permission denied May 24 07:11:31 removed collectd[4592]: interface plugin: fopen: Permission denied May 24 07:14:11 removed collectd[4592]: interface plugin: fopen: Permission denied # Each of the permission denied messages can be matched with a SELinux denial in the audit log. Version-Release number of selected component (if applicable): collectd-5.12.0-24.el9.x86_64 selinux-policy-38.1.12-1.el9.noarch selinux-policy-targeted-38.1.12-1.el9.noarch How reproducible: * always Steps to Reproduce: 1. get a RHEL-9.3 machine (targeted policy is active) 2. install the collectd package 3. start the collectd service 4. search for SELinux denials Actual results (enforcing mode): ---- type=PROCTITLE msg=audit(05/24/2023 07:09:11.293:347) : proctitle=/usr/sbin/collectd type=PATH msg=audit(05/24/2023 07:09:11.293:347) : item=0 name=/proc/net/dev nametype=UNKNOWN cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(05/24/2023 07:09:11.293:347) : cwd=/var/lib/collectd type=SYSCALL msg=audit(05/24/2023 07:09:11.293:347) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=AT_FDCWD a1=0x7f74cff191e0 a2=O_RDONLY a3=0x0 items=1 ppid=1 pid=4592 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=reader#0 exe=/usr/sbin/collectd subj=system_u:system_r:collectd_t:s0 key=(null) type=AVC msg=audit(05/24/2023 07:09:11.293:347) : avc: denied { read } for pid=4592 comm=reader#0 name=net dev="proc" ino=4026531845 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=lnk_file permissive=0 ---- Expected results: * no SELinux denials Additional info: * the collectd package comes from EPEL
# find /proc/ -inum 4026531845 /proc/net # ls -ldZ /proc/net lrwxrwxrwx. 1 root root system_u:object_r:proc_net_t:s0 8 May 24 06:56 /proc/net -> self/net #
Actual results (permissive mode): ---- type=PROCTITLE msg=audit(05/24/2023 07:22:04.399:360) : proctitle=/usr/sbin/collectd type=PATH msg=audit(05/24/2023 07:22:04.399:360) : item=0 name=/proc/net/dev inode=4026532012 dev=00:14 mode=file,444 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:proc_net_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(05/24/2023 07:22:04.399:360) : cwd=/var/lib/collectd type=SYSCALL msg=audit(05/24/2023 07:22:04.399:360) : arch=x86_64 syscall=openat success=yes exit=3 a0=AT_FDCWD a1=0x7f3574d641e0 a2=O_RDONLY a3=0x0 items=1 ppid=1 pid=4693 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=reader#1 exe=/usr/sbin/collectd subj=system_u:system_r:collectd_t:s0 key=(null) type=AVC msg=audit(05/24/2023 07:22:04.399:360) : avc: denied { read } for pid=4693 comm=reader#1 name=net dev="proc" ino=4026531845 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=lnk_file permissive=1 ---- Additional SELinux denials did NOT appear.
PR: https://github.com/fedora-selinux/selinux-policy/pull/1741
Commit to backport: f4847d50d (HEAD -> rawhide, upstream/rawhide) Allow collectd_t read proc_net link files Allow collectd read generic symbolic links in /proc
These two commits were merged upstream: 9a02a239e Allow collectd_t read network state symlinks 235763507 Revert "Allow collectd_t read proc_net link files"