Bug 1564428

Summary: SELinux is preventing chown from 'setattr' accesses on the fifo_file .
Product: [Fedora] Fedora Reporter: Joël Wijngaarde <wijngaarde>
Component: container-selinuxAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: amurdaca, dwalsh, fkluknav, jchaloup, lsm5, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ddb5c4ce8cf3204afafcc66840948c0adecca245920177be983ae472ed819285;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-30 22:39:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joël Wijngaarde 2018-04-06 09:00:41 UTC
Description of problem:
This selinux error pops up when I run `docker-compose` up with the following `docker-compose.yaml` :

version: '2'
services:
  postgres:
    image: postgres
    ports:
     - "5432:5432"
    environment:
      - POSTGRES_PASSWORD=postgres
  redis:
    image: "redis:alpine"
    ports:
      - "6379:6379"
  mongodb:
    image: mongo
    ports:
     - "27017:27017"

SELinux is preventing chown from 'setattr' accesses on the fifo_file .

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

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

Additional Information:
Source Context                system_u:system_r:container_t:s0:c642,c680
Target Context                system_u:system_r:container_runtime_t:s0
Target Objects                 [ fifo_file ]
Source                        chown
Source Path                   chown
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-283.30.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.15.14-300.fc27.x86_64 #1 SMP Thu
                              Mar 29 16:13:44 UTC 2018 x86_64 x86_64
Alert Count                   8
First Seen                    2018-03-30 14:07:20 CEST
Last Seen                     2018-04-06 10:55:43 CEST
Local ID                      7c973764-40ee-49fc-9a43-e927faf969a5

Raw Audit Messages
type=AVC msg=audit(1523004943.997:757): avc:  denied  { setattr } for  pid=29086 comm="chown" name="" dev="pipefs" ino=770713 scontext=system_u:system_r:container_t:s0:c642,c680 tcontext=system_u:system_r:container_runtime_t:s0 tclass=fifo_file permissive=0


Hash: chown,container_t,container_runtime_t,fifo_file,setattr

Version-Release number of selected component:
selinux-policy-3.13.1-283.30.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.15.14-300.fc27.x86_64
type:           libreport

Comment 1 Daniel Walsh 2018-04-06 12:17:02 UTC
Does everything complete successfully?

This is a tool trying to manipulate the TTY handed into it from the Docker Daemon.  We could just don't audit this if everything worked fine, but you see the AVC.

Probably not something we want to allow in general