Bug 1325495

Summary: SELinux is preventing mkdir from 'write' accesses on the directory /.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b60da09336fde4f67ca20f45eb39e38825a254748549b670c6b9a796e549b8a2;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-11 20:19:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mikhail 2016-04-09 09:19:56 UTC
Description of problem:
SELinux is preventing mkdir from 'write' accesses on the directory /.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow daemons to dump core
Then you must tell SELinux about this by enabling the 'daemons_dump_core' boolean.
You can read 'None' man page for more details.
Do
setsebool -P daemons_dump_core 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that mkdir should be allowed write access on the  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 mkdir --raw | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:fail2ban_t:s0
Target Context                system_u:object_r:root_t:s0
Target Objects                / [ dir ]
Source                        mkdir
Source Path                   mkdir
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           filesystem-3.2-35.fc23.x86_64
Policy RPM                    selinux-policy-3.13.1-158.12.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.4.6-301.fc23.x86_64 #1 SMP Wed
                              Mar 30 16:43:58 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-04-09 13:19:15 YEKT
Last Seen                     2016-04-09 13:19:15 YEKT
Local ID                      92150f7f-c3bb-41a0-a8bc-d52de3461075

Raw Audit Messages
type=AVC msg=audit(1460189955.3:276): avc:  denied  { write } for  pid=1148 comm="mkdir" name="/" dev="sda4" ino=2 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir permissive=0


Hash: mkdir,fail2ban_t,root_t,dir,write

Version-Release number of selected component:
selinux-policy-3.13.1-158.12.fc23.noarch

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.6-301.fc23.x86_64
type:           libreport

Comment 1 Daniel Walsh 2016-04-11 20:19:01 UTC
This avc shows that the fail2ban script is trying to create a directory in /?  This is probably not what you wanted, so SELinux blocks it.

I would figure you intend fail2ban to write to a homedir, which is not setup correctly when fail2ban runs.