Bug 1956139 - SELinux is preventing mktemp from 'write' accesses on the directory tlp.
Summary: SELinux is preventing mktemp from 'write' accesses on the directory tlp.
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 34
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:96295767b9a72b7d5b6b998583f...
: 1956141 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2021-05-03 00:09 UTC by Alexander Scheel
Modified: 2021-05-07 01:03 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-34.5-1.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-05-07 01:03:04 UTC
Type: ---

Attachments (Terms of Use)

Description Alexander Scheel 2021-05-03 00:09:54 UTC
Description of problem:
Same as https://bugzilla.redhat.com/show_bug.cgi?id=1941445: 

Upgraded from F33->F34, touch /.autorelabel, closed laptop lid, came back, opened it back up and got a ton new alerts (~28 before, now at ~114!).
SELinux is preventing mktemp from 'write' accesses on the directory tlp.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that mktemp should be allowed write access on the tlp directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# ausearch -c 'mktemp' --raw | audit2allow -M my-mktemp
# semodule -X 300 -i my-mktemp.pp

Additional Information:
Source Context                system_u:system_r:systemd_sleep_t:s0
Target Context                system_u:object_r:var_run_t:s0
Target Objects                tlp [ dir ]
Source                        mktemp
Source Path                   mktemp
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-34.3-1.fc34.noarch
Local Policy RPM              selinux-policy-targeted-34.3-1.fc34.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 5.11.16-300.fc34.x86_64 #1 SMP Wed
                              Apr 21 13:18:33 UTC 2021 x86_64 x86_64
Alert Count                   1
First Seen                    2021-05-02 20:01:03 EDT
Last Seen                     2021-05-02 20:01:03 EDT
Local ID                      f4adbc1c-142b-4d51-831c-caadb546bf09

Raw Audit Messages
type=AVC msg=audit(1620000063.561:1343): avc:  denied  { write } for  pid=9868 comm="mktemp" name="tlp" dev="tmpfs" ino=895 scontext=system_u:system_r:systemd_sleep_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=dir permissive=1

Hash: mktemp,systemd_sleep_t,var_run_t,dir,write

Version-Release number of selected component:

Additional info:
component:      selinux-policy
reporter:       libreport-2.14.0
hashmarkername: setroubleshoot
kernel:         5.11.16-300.fc34.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2021-05-03 11:17:52 UTC
*** Bug 1956141 has been marked as a duplicate of this bug. ***

Comment 2 Zdenek Pytela 2021-05-03 17:36:27 UTC
I've submitted a Fedora PR to address the issue:

Comment 3 Fedora Update System 2021-05-05 14:48:12 UTC
FEDORA-2021-b9564e597a has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-b9564e597a

Comment 4 Fedora Update System 2021-05-06 01:58:16 UTC
FEDORA-2021-b9564e597a has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-b9564e597a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-b9564e597a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2021-05-07 01:03:04 UTC
FEDORA-2021-b9564e597a has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

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