Bug 1370779 - SELinux is preventing ksmtuned from 'write' accesses on the directory ksm.
Summary: SELinux is preventing ksmtuned from 'write' accesses on the directory ksm.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:260f4ec05ad8e364ade139acc82...
: 1402190 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-27 07:40 UTC by Sidney Sedlak
Modified: 2017-12-12 10:23 UTC (History)
24 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:23:33 UTC
Type: ---


Attachments (Terms of Use)

Description Sidney Sedlak 2016-08-27 07:40:52 UTC
Description of problem:
SELinux is preventing ksmtuned from 'write' accesses on the directory ksm.

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

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

Additional Information:
Source Context                system_u:system_r:ksmtuned_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                ksm [ dir ]
Source                        ksmtuned
Source Path                   ksmtuned
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.13.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.7.2-200.fc24.x86_64 #1 SMP Mon
                              Aug 22 18:36:05 UTC 2016 x86_64 x86_64
Alert Count                   2
First Seen                    2016-08-26 19:36:09 CEST
Last Seen                     2016-08-26 19:36:09 CEST
Local ID                      b0c276ca-d691-460e-9fa3-c9025ed2b5f0

Raw Audit Messages
type=AVC msg=audit(1472232969.577:291): avc:  denied  { write } for  pid=1398 comm="ksmtuned" name="ksm" dev="sysfs" ino=6558 scontext=system_u:system_r:ksmtuned_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0


Hash: ksmtuned,ksmtuned_t,sysfs_t,dir,write

Version-Release number of selected component:
selinux-policy-3.13.1-191.13.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.2-200.fc24.x86_64
type:           libreport

Comment 1 Juan Orti 2016-09-04 10:54:22 UTC
Same here with selinux-policy-3.13.1-191.14.fc24.noarch


SELinux is preventing ksmtuned from write access on the directory ksm.

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

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

Additional Information:
Source Context                system_u:system_r:ksmtuned_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                ksm [ dir ]
Source                        ksmtuned
Source Path                   ksmtuned
Port                          <Unknown>
Host                          helio
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.13.1-191.14.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     helio
Platform                      Linux helio 4.7.2-201.fc24.x86_64 #1 SMP Fri Aug
                              26 15:58:40 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-09-03 13:31:14 CEST
Last Seen                     2016-09-03 13:31:14 CEST
Local ID                      7b35f3f5-e6e5-48d1-bf00-196fabd8f51e

Raw Audit Messages
type=AVC msg=audit(1472902274.887:375): avc:  denied  { write } for  pid=841 comm="ksmtuned" name="ksm" dev="sysfs" ino=2246 scontext=system_u:system_r:ksmtuned_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0


Hash: ksmtuned,ksmtuned_t,sysfs_t,dir,write

Comment 2 Fedora Admin XMLRPC Client 2016-09-27 15:12:58 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Reto Gantenbein 2016-12-07 01:24:16 UTC
Still there:

SELinux is preventing ksmtuned from write access on the directory ksm.

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

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


Additional Information:
Source Context                system_u:system_r:ksmtuned_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                ksm [ dir ]
Source                        ksmtuned
Source Path                   ksmtuned
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.21.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.8.10-200.fc24.x86_64 #1
                              SMP Mon Nov 21 17:55:46 UTC 2016 x86_64 x86_64
Alert Count                   576
First Seen                    2016-10-13 03:51:15 CEST
Last Seen                     2016-12-07 02:19:20 CET
Local ID                      fc8c84e5-2e3a-4f55-92f7-17ead254c430

Raw Audit Messages
type=AVC msg=audit(1481073560.325:88843): avc:  denied  { write } for  pid=1664 comm="ksmtuned" name="ksm" dev="sysfs" ino=2267 scontext=system_u:system_r:ksmtuned_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1


Hash: ksmtuned,ksmtuned_t,sysfs_t,dir,write

Comment 4 Michael Hampton 2016-12-07 02:13:12 UTC
*** Bug 1402190 has been marked as a duplicate of this bug. ***

Comment 5 Futur Fusionneur 2016-12-17 03:14:53 UTC
Reported on Centos 7.3 running elrepo kernel 4.9.0-1 as well,


[root@centfusion lab]# cat /etc/*-release | grep release | uniq ; uname -a
CentOS Linux release 7.3.1611 (Core) 
Linux centfusion 4.9.0-1.el7.elrepo.x86_64 #1 SMP Sun Dec 11 15:43:54 EST 2016 x86_64 x86_64 x86_64 GNU/Linux


[root@centfusion lab]# rpm -qa | grep selinux-policy-3
selinux-policy-3.13.1-102.el7_3.7.noarch



SELinux is preventing /usr/bin/bash from write access on the directory ksm.

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

If you believe that bash should be allowed write access on the ksm 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 'ksmtuned' --raw | audit2allow -M my-ksmtuned
# semodule -i my-ksmtuned.pp


Additional Information:
Source Context                system_u:system_r:ksmtuned_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                ksm [ dir ]
Source                        ksmtuned
Source Path                   /usr/bin/bash
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages           bash-4.2.46-21.el7_3.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-102.el7_3.7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     centfusion
Platform                      Linux centfusion 4.9.0-1.el7.elrepo.x86_64 #1 SMP
                              Sun Dec 11 15:43:54 EST 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-12-14 00:21:38 EET
Last Seen                     2016-12-14 00:21:38 EET
Local ID                      33925d05-09d5-4245-9442-a29afbd12e2c

Raw Audit Messages
type=AVC msg=audit(1481667698.753:1206): avc:  denied  { write } for  pid=27663 comm="ksmtuned" name="ksm" dev="sysfs" ino=1160 scontext=system_u:system_r:ksmtuned_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0


type=SYSCALL msg=audit(1481667698.753:1206): arch=x86_64 syscall=open success=yes exit=ESRCH a0=1e03020 a1=241 a2=1b6 a3=0 items=0 ppid=1 pid=27663 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ksmtuned exe=/usr/bin/bash subj=system_u:system_r:ksmtuned_t:s0 key=(null)

Hash: ksmtuned,ksmtuned_t,sysfs_t,dir,write

Comment 6 Robert Hager 2017-01-18 13:01:19 UTC
Description of problem:
start two virtual machines with KSM service enabled

Version-Release number of selected component:
selinux-policy-3.13.1-225.3.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.15-300.fc25.x86_64
type:           libreport

Comment 7 ricky.tigg 2017-02-14 08:52:27 UTC
Description of problem:
Hi. In the Fedora OS (host), I enabled the service memory-saving de-duplication Kernel Samepage Merging (KSM) and ksmtuned service which is provided in the KSM package as follow:
service ksm start
service ksmtuned start
chkconfig ksm on
chkconfig ksmtuned on

The virtual machines (Guests) may have or not the KSM service enabled and running; the current error occurs in both cases.

I have reason to believe that ksmtuned should be allowed write access on the ksm direstory by default.

Version-Release number of selected component:
selinux-policy-3.13.1-225.6.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.9.8-201.fc25.x86_64
type:           libreport

Comment 8 rob.verduijn 2017-02-22 08:28:58 UTC
Description of problem:
While starting the ksm deamon it generated an selinux alert.
After applying the suggested custom policy all was well again

Version-Release number of selected component:
selinux-policy-3.13.1-225.6.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.9.10-200.fc25.x86_64
type:           libreport

Comment 9 Mike Goodwin 2017-06-11 05:34:58 UTC
Description of problem:
No noticeable trigger, just using the system with ksmd running 

Version-Release number of selected component:
selinux-policy-3.13.1-225.16.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.11.3-202.fc25.x86_64
type:           libreport

Comment 10 Mike Goodwin 2017-06-30 15:25:11 UTC
Description of problem:
I have ksmd going but no virtual machines going at the moment so I'm not sure what it's doing exactly 

Version-Release number of selected component:
selinux-policy-3.13.1-225.19.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.11.7-200.fc25.x86_64
type:           libreport

Comment 11 John Edrington 2017-08-23 15:19:38 UTC
Description of problem:
Running multiple VMs with high cpu/memory usage caused ksm to start and the selinux denied occured.

Version-Release number of selected component:
selinux-policy-3.13.1-225.19.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.11.12-200.fc25.x86_64
type:           libreport

Comment 12 Fedora End Of Life 2017-11-16 19:51:24 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2017-12-12 10:23:33 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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 please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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