Bug 1435868 - SELinux is preventing systemd-sysctl from 'write' accesses on the file ptrace_scope.
Summary: SELinux is preventing systemd-sysctl from 'write' accesses on the file ptrace...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:e1b73bba2d85f25dd961c04ec05...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-25 05:55 UTC by M. Edward (Ed) Borasky
Modified: 2018-07-18 19:53 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-03-27 13:22:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description M. Edward (Ed) Borasky 2017-03-25 05:55:22 UTC
Description of problem:
SELinux is preventing systemd-sysctl from 'write' accesses on the file ptrace_scope.

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

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

Additional Information:
Source Context                system_u:system_r:container_t:s0:c248,c817
Target Context                system_u:object_r:sysctl_kernel_t:s0
Target Objects                ptrace_scope [ file ]
Source                        systemd-sysctl
Source Path                   systemd-sysctl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.11.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.9.14-200.fc25.x86_64 #1 SMP Mon
                              Mar 13 19:26:40 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-03-24 22:53:43 PDT
Last Seen                     2017-03-24 22:53:43 PDT
Local ID                      2818407c-c1fe-4b4d-8c6b-d61d649dbc78

Raw Audit Messages
type=AVC msg=audit(1490421223.448:1164): avc:  denied  { write } for  pid=20081 comm="systemd-sysctl" name="ptrace_scope" dev="proc" ino=3972199 scontext=system_u:system_r:container_t:s0:c248,c817 tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=file permissive=0


Hash: systemd-sysctl,container_t,sysctl_kernel_t,file,write

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

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

Comment 1 Daniel Walsh 2017-03-27 13:22:22 UTC
What were you trying to do in the container.  Seems to be something that should be blocked?  Allowing a container to modify this is probably required to run a privileged container or at least disable SELinux.

--privileged 
or
--security-opt label=disabled


If you believe a non privileged container should be allowed to modify the ptrace_scope, then please reopen the container.  

Do you know if ptrace_scope is namespaced?

Comment 2 Jan Pazdziora (Red Hat) 2018-07-18 19:53:10 UTC
The issues is present with current Fedora hosts and fedora images when upgrading elfutils-default-yama-scope, bug 1602914.


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