Bug 1325495 - SELinux is preventing mkdir from 'write' accesses on the directory /.
Summary: SELinux is preventing mkdir from 'write' accesses on the directory /.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 23
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:b60da09336fde4f67ca20f45eb3...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-09 09:19 UTC by Mikhail
Modified: 2016-04-11 20:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-11 20:19:01 UTC
Type: ---


Attachments (Terms of Use)

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.


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