Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: SELinux is preventing tlp from 'search' accesses on the directory /var/lib/snapd. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that tlp should be allowed search access on the snapd 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 'tlp' --raw | audit2allow -M my-tlp # semodule -X 300 -i my-tlp.pp Additional Information: Source Context system_u:system_r:tlp_t:s0 Target Context system_u:object_r:snappy_var_lib_t:s0 Target Objects /var/lib/snapd [ dir ] Source tlp Source Path tlp Port <Unknown> Host (removed) Source RPM Packages Target RPM Packages snapd-2.58.3-1.fc38.x86_64 SELinux Policy RPM selinux-policy-targeted-38.20-1.fc38.noarch Local Policy RPM selinux-policy-targeted-38.20-1.fc38.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 6.3.8-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 15 02:15:40 UTC 2023 x86_64 Alert Count 4 First Seen 2023-07-06 20:58:40 MST Last Seen 2023-07-06 21:05:40 MST Local ID e65515ce-57b5-470b-b644-9ad9fa202268 Raw Audit Messages type=AVC msg=audit(1688702740.356:143): avc: denied { search } for pid=2290 comm="tlp" name="snapd" dev="dm-1" ino=1196594 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:snappy_var_lib_t:s0 tclass=dir permissive=0 Hash: tlp,tlp_t,snappy_var_lib_t,dir,search Version-Release number of selected component: selinux-policy-targeted-38.20-1.fc38.noarch Additional info: reporter: libreport-2.17.11 kernel: 6.3.8-200.fc38.x86_64 reason: SELinux is preventing tlp from 'search' accesses on the directory /var/lib/snapd. hashmarkername: setroubleshoot component: selinux-policy type: libreport package: selinux-policy-targeted-38.20-1.fc38.noarch component: selinux-policy
Created attachment 1974396 [details] File: description
Created attachment 1974397 [details] File: os_info
Hi Robert, do you know how and when is it happening? Thank you, Nikola
They usually pop up when I log in after a reboot.
Caught in enforcing mode: ---- type=PROCTITLE msg=audit(10/09/2023 09:43:55.946:530) : proctitle=/usr/bin/sh /usr/sbin/tlp init start type=PATH msg=audit(10/09/2023 09:43:55.946:530) : item=0 name=/var/lib/snapd/snap/bin/laptop_mode nametype=UNKNOWN cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(10/09/2023 09:43:55.946:530) : cwd=/ type=SYSCALL msg=audit(10/09/2023 09:43:55.946:530) : arch=x86_64 syscall=newfstatat success=no exit=EACCES(Permission denied) a0=AT_FDCWD a1=0x55c8ee3cf540 a2=0x7fff35f467a0 a3=0x0 items=1 ppid=1 pid=2020 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=tlp exe=/usr/bin/bash subj=system_u:system_r:tlp_t:s0 key=(null) type=AVC msg=audit(10/09/2023 09:43:55.946:530) : avc: denied { search } for pid=2020 comm=tlp name=snapd dev="vda2" ino=262246 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:snappy_var_lib_t:s0 tclass=dir permissive=0 ---- Steps to Reproduce: 1) install the tlp package 2) install the snapd package (it brings the snapd-selinux package too) 3) start the tlp service # rpm -qa tlp\* snap\* selinux\* | sort selinux-policy-38.28-1.fc38.noarch selinux-policy-targeted-38.28-1.fc38.noarch snap-confine-2.58.3-1.fc38.x86_64 snapd-2.58.3-1.fc38.x86_64 snapd-selinux-2.58.3-1.fc38.noarch tlp-1.5.0-5.fc38.noarch #
Caught in permissive mode: ---- type=PROCTITLE msg=audit(10/09/2023 09:47:03.775:534) : proctitle=/usr/bin/sh /usr/sbin/tlp init stop type=PATH msg=audit(10/09/2023 09:47:03.775:534) : item=0 name=/var/lib/snapd/snap/bin/laptop_mode nametype=UNKNOWN cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(10/09/2023 09:47:03.775:534) : cwd=/ type=SYSCALL msg=audit(10/09/2023 09:47:03.775:534) : arch=x86_64 syscall=newfstatat success=no exit=ENOENT(No such file or directory) a0=AT_FDCWD a1=0x562ca46c9e60 a2=0x7ffcad810c90 a3=0x0 items=1 ppid=1 pid=2110 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=tlp exe=/usr/bin/bash subj=system_u:system_r:tlp_t:s0 key=(null) type=AVC msg=audit(10/09/2023 09:47:03.775:534) : avc: denied { search } for pid=2110 comm=tlp name=snapd dev="vda2" ino=262246 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:snappy_var_lib_t:s0 tclass=dir permissive=1 ---- If I remember correctly, there is more Fedora BZs affected by a similar issue.
Test coverage for this BZ exists in a form of PR: * https://src.fedoraproject.org/tests/selinux/pull-request/432 The PR waits for a review.
*** Bug 2214809 has been marked as a duplicate of this bug. ***
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21. Fedora Linux 38 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.