Bug 1126184 - SELinux is preventing /usr/bin/touch from 'write' accesses on the file .
Summary: SELinux is preventing /usr/bin/touch from 'write' accesses on the file .
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:633b604196b866e9321802de09e...
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-03 09:23 UTC by Michal Nowak
Modified: 2014-08-04 08:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-04 06:40:36 UTC

Attachments (Terms of Use)

Description Michal Nowak 2014-08-03 09:23:39 UTC
Description of problem:
Started ksm and ksmtuned services via systemadm tool.
SELinux is preventing /usr/bin/touch from 'write' accesses on the file .

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

If you believe that touch should be allowed write access on the  file 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:
# grep touch /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:ksmtuned_t:s0
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                 [ file ]
Source                        touch
Source Path                   /usr/bin/touch
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.21-21.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-179.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.15.7-200.fc20.x86_64 #1 SMP Mon
                              Jul 28 18:50:26 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-08-03 11:22:09 CEST
Last Seen                     2014-08-03 11:22:09 CEST
Local ID                      a81464b9-910d-4b1d-a0f1-9e017dc1e9f5

Raw Audit Messages
type=AVC msg=audit(1407057729.185:355): avc:  denied  { write } for  pid=28568 comm="touch" name="ksmtune.pid" dev="tmpfs" ino=2049718 scontext=system_u:system_r:ksmtuned_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file

type=SYSCALL msg=audit(1407057729.185:355): arch=x86_64 syscall=utimensat success=no exit=EACCES a0=ffffffffffffff9c a1=7fffe36b7f6d a2=0 a3=0 items=0 ppid=28566 pid=28568 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=touch exe=/usr/bin/touch subj=system_u:system_r:ksmtuned_t:s0 key=(null)

Hash: touch,ksmtuned_t,var_run_t,file,write

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.15.7-200.fc20.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-08-04 06:40:36 UTC
Any chance you have ever started ksmtuned by hand?

# restorecon -v /var/run/ksmtune.pid

will fix it.

Comment 2 Michal Nowak 2014-08-04 08:25:22 UTC
Indeed I did. Thanks for the fix.

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