Bug 994483 - SELinux is preventing /usr/bin/mkdir from 'create' accesses on the directory pluto.
SELinux is preventing /usr/bin/mkdir from 'create' accesses on the directory ...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2013-08-07 07:23 EDT by Gerd Hoffmann
Modified: 2014-06-17 22:23 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 07:01:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gerd Hoffmann 2013-08-07 07:23:37 EDT
Description of problem:
try start ipsec vpn connection
SELinux is preventing /usr/bin/mkdir from 'create' accesses on the directory pluto.

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

If you believe that mkdir should be allowed create access on the pluto directory 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 mkdir /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:ipsec_mgmt_t:s0
Target Context                system_u:object_r:var_run_t:s0
Target Objects                pluto [ dir ]
Source                        mkdir
Source Path                   /usr/bin/mkdir
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.21-11.el7.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-56.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.10.0-6.el7.x86_64 #1 SMP Tue Aug
                              6 17:22:48 EDT 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-08-07 13:13:26 CEST
Last Seen                     2013-08-07 13:13:26 CEST
Local ID                      90a67b3a-bbac-4659-9474-72e7f2378355

Raw Audit Messages
type=AVC msg=audit(1375874006.489:497): avc:  denied  { create } for  pid=2921 comm="mkdir" name="pluto" scontext=system_u:system_r:ipsec_mgmt_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=dir

type=SYSCALL msg=audit(1375874006.489:497): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=7fff98d4beb0 a1=1ed a2=1ed a3=3f363bacac items=0 ppid=2918 pid=2921 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=mkdir exe=/usr/bin/mkdir subj=system_u:system_r:ipsec_mgmt_t:s0 key=(null)

Hash: mkdir,ipsec_mgmt_t,var_run_t,dir,create

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.10.0-6.el7.x86_64
type:           libreport
Comment 2 Miroslav Grepl 2013-08-08 07:42:35 EDT
Could you test it with the latest policy builds.
Comment 3 Gerd Hoffmann 2013-08-08 08:30:05 EDT
Retested with selinux-policy-3.12.1-69.el7.noarch, still happens.
Comment 4 Miroslav Grepl 2013-08-08 09:15:00 EDT
If you switch to permissive and run

# ls -dZ /run/pluto

what does it show?
Comment 5 Gerd Hoffmann 2013-08-09 02:34:46 EDT
[root@nilsson ~]# ls -dZ /run/pluto
drwx------. root root system_u:object_r:var_run_t:s0   /run/pluto
Comment 6 Gerd Hoffmann 2013-08-09 02:39:57 EDT
Grabbed libreswan-3.5-1.el7.x86_64 (which will replace openswan in rhel7 according to tech-list) from brew, tried again, same result.
Comment 7 Miroslav Grepl 2013-08-19 06:22:01 EDT
# restorecon -R -v /run/pluto

will fix it.

commit d55febf21b41bb0b430dc1bcc81759e085aba9a9
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Mon Aug 19 12:19:50 2013 +0200

    Make sure /run/pluto dir is created with correct labeling
Comment 9 Ludek Smid 2014-06-13 07:01:32 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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