Bug 1369286

Summary: SELinux is preventing conftest from 'module_request' accesses on the system Unknown.
Product: [Fedora] Fedora Reporter: M. Edward (Ed) Borasky <znmeb>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:dac971f3cf35c6d59e6fb83e3cdad51b838d50dcb82cfe607bc057a44a2df41d;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-23 10:31:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: Dockerfile none

Description M. Edward (Ed) Borasky 2016-08-23 02:17:14 UTC
Description of problem:
Building a Docker image on a Fedora host 
SELinux is preventing conftest from 'module_request' accesses on the system Unknown.

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

If you want to allow domain to kernel load modules
Then you must tell SELinux about this by enabling the 'domain_kernel_load_modules' boolean.
You can read 'None' man page for more details.
Do
setsebool -P domain_kernel_load_modules 1

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

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

Additional Information:
Source Context                system_u:system_r:svirt_lxc_net_t:s0:c379,c867
Target Context                system_u:system_r:kernel_t:s0
Target Objects                Unknown [ system ]
Source                        conftest
Source Path                   conftest
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    <Unknown>
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.6.6-300.fc24.x86_64 #1 SMP Wed
                              Aug 10 21:07:35 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-08-22 19:13:33 PDT
Last Seen                     2016-08-22 19:13:33 PDT
Local ID                      d60efa0e-4673-4994-b4c2-db4e20a1e81c

Raw Audit Messages
type=AVC msg=audit(1471918413.599:318): avc:  denied  { module_request } for  pid=18536 comm="conftest" kmod="net-pf-30" scontext=system_u:system_r:svirt_lxc_net_t:s0:c379,c867 tcontext=system_u:system_r:kernel_t:s0 tclass=system permissive=0


Hash: conftest,svirt_lxc_net_t,kernel_t,system,module_request


Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.6.6-300.fc24.x86_64
type:           libreport

Comment 1 M. Edward (Ed) Borasky 2016-08-23 02:17:19 UTC
Created attachment 1193111 [details]
File: Dockerfile

Comment 2 Daniel Walsh 2016-08-23 10:31:57 UTC
I am not sure if we want to allow unprivileged containers to request that the kernel loads modules.

Looks like there is a boolean to allow the loading of modules by all domains, so I think you should set this, if you want this behaviour.

setsebool -P domain_kernel_load_modules 1

Or have the module loaded before running your contianer.