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 1690370 - SELinux is preventing watchdog from 'write' accesses on the file watchdog.pid.
Summary: SELinux is preventing watchdog from 'write' accesses on the file watchdog.pid.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:24504d98b8a16aea535ff6779dc...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-19 10:55 UTC by Doncho Gunchev
Modified: 2019-04-10 15:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-10 15:42:09 UTC


Attachments (Terms of Use)

Description Doncho Gunchev 2019-03-19 10:55:56 UTC
Description of problem:
systemctl start watchdog
SELinux is preventing watchdog from 'write' accesses on the file watchdog.pid.

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

If you believe that watchdog should be allowed write access on the watchdog.pid file 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 'watchdog' --raw | audit2allow -M my-watchdog
# semodule -X 300 -i my-watchdog.pp

Additional Information:
Source Context                system_u:system_r:watchdog_t:s0
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                watchdog.pid [ file ]
Source                        watchdog
Source Path                   watchdog
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-51.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.20.16-200.fc29.x86_64 #1 SMP Thu
                              Mar 14 15:10:22 UTC 2019 x86_64 x86_64
Alert Count                   1
First Seen                    2019-03-19 12:08:57 EET
Last Seen                     2019-03-19 12:08:57 EET
Local ID                      163cf5b2-5225-4c5d-931d-fd8631fd78d4

Raw Audit Messages
type=AVC msg=audit(1552990137.995:1070): avc:  denied  { write } for  pid=8217 comm="watchdog" name="watchdog.pid" dev="tmpfs" ino=101515 scontext=system_u:system_r:watchdog_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file permissive=0


Hash: watchdog,watchdog_t,var_run_t,file,write


restorecon -Rv /var/run/ does nothing

Version-Release number of selected component:
selinux-policy-3.14.2-51.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         4.20.16-200.fc29.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2019-03-19 12:20:51 UTC
Hi,

Thank you for reporting the issue. Can you find out where the file is located?

If it is /var/run/watchdog.pid, the following command should be sufficient:

  # restorecon -Rv /var/run/watchdog.pid

or running it recursively on /run which is the actual directory:

  # restorecon -Rvn /run

Comment 2 Zdenek Pytela 2019-03-28 17:28:45 UTC
Doncho,

Could you please help with locating the pid file and answer if giving it the correct label helped to resolve our issue?

Comment 3 Doncho Gunchev 2019-04-10 14:07:33 UTC
selinux-policy-3.14.2-53.fc29.noarch and kernel-5.0.6-200.fc29.x86_64 do not have this problem any more, 10x.

Comment 4 Zdenek Pytela 2019-04-10 15:42:09 UTC
Thank you for confirming the issue is gone now. Closing the bugzilla as NOTABUG, but feel free to reopen it if the issue persists.


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