Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1689186 - SELinux is preventing tlp from 'write' accesses on the Datei lock_tlp.
Summary: SELinux is preventing tlp from 'write' accesses on the Datei lock_tlp.
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 30
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:0fe6c4e97436995837796a159e9...
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-15 11:18 UTC by J. Haas
Modified: 2019-03-20 21:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)

Description J. Haas 2019-03-15 11:18:37 UTC
Description of problem:
Waking up from standby
SELinux is preventing tlp from 'write' accesses on the Datei lock_tlp.

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

Wenn Sie denken, dass es tlp standardmäßig erlaubt sein sollte, write Zugriff auf lock_tlp file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# 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:var_run_t:s0
Target Objects                lock_tlp [ file ]
Source                        tlp
Source Path                   tlp
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-23.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.0.0-300.fc30.x86_64 #1 SMP Mon
                              Mar 4 22:46:48 UTC 2019 x86_64 x86_64
Alert Count                   4
First Seen                    2019-03-15 11:59:12 CET
Last Seen                     2019-03-15 12:16:31 CET
Local ID                      fca7c2e8-942f-4176-9953-4a50f6ff2970

Raw Audit Messages
type=AVC msg=audit(1552648591.621:311): avc:  denied  { write } for  pid=5218 comm="tlp" name="lock_tlp" dev="tmpfs" ino=26266 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=0

Hash: tlp,tlp_t,var_run_t,file,write

Version-Release number of selected component:

Additional info:
component:      selinux-policy
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.0.0-300.fc30.x86_64
type:           libreport

Potential duplicate: bug 1562382

Comment 1 Lukas Vrabec 2019-03-20 20:48:07 UTC

How did you start tlp? Using systemctl? 


Comment 2 J. Haas 2019-03-20 20:50:39 UTC
I guess? As far as I can see, it runs automatically every boot:

[jh@xps ~]$ sudo systemctl status tlp
● tlp.service - TLP system startup/shutdown
   Loaded: loaded (/usr/lib/systemd/system/tlp.service; enabled; vendor preset: enabled)
   Active: active (exited) since Wed 2019-03-20 21:12:03 CET; 37min ago
  Process: 2043 ExecStart=/usr/sbin/tlp init start (code=exited, status=0/SUCCESS)
 Main PID: 2043 (code=exited, status=0/SUCCESS)

Mär 20 21:12:02 xps systemd[1]: Starting TLP system startup/shutdown...
Mär 20 21:12:03 xps tlp[2043]: Applying power save settings...done.
Mär 20 21:12:03 xps tlp[2043]: Setting battery charge thresholds...done.
Mär 20 21:12:03 xps systemd[1]: Started TLP system startup/shutdown.

Comment 3 Lukas Vrabec 2019-03-20 21:04:21 UTC
Could you remove file "lock_tlp" and try to reproduce the scenario? 


Comment 4 J. Haas 2019-03-20 21:16:18 UTC
I assume you mean /run/tlp/lock_tlp, it's in the run directory, so it should be recreated every boot? In that case deleting it probably doesn't fix the problem as it's regularly deleted anyway.

[jh@xps ~]$ LANG=C stat /run/tlp/lock_tlp 
  File: /run/tlp/lock_tlp
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: 17h/23d	Inode: 46615       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:tlp_var_run_t:s0
Access: 2019-03-20 21:12:02.638706927 +0100
Modify: 2019-03-20 22:12:12.212003982 +0100
Change: 2019-03-20 22:12:12.212003982 +0100
 Birth: -

The SE-Linux denial isn't really reproducible, it only happens sometimes after opening the laptop lid. If you have any idea how to reproduce, please comment.

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