Bug 733830

Summary: SELinux is preventing /usr/sbin/brctl from using the 'sys_module' capabilities.
Product: [Fedora] Fedora Reporter: Henry Rust <henryrust89>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, eparis, mgrepl, mhayden
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:e76a1b0a3803f58c6d12b8b1fec5024324ea5c23fd1e6a5d3a5aadce0ce6996d
Fixed In Version: selinux-policy-3.9.16-48.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-04 02:34:35 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 Henry Rust 2011-08-27 10:18:22 UTC
SELinux is preventing /usr/sbin/brctl from using the 'sys_module' capabilities.

*****  Plugin sys_module (99.5 confidence) suggests  *************************

If you do not believe that /usr/sbin/brctl should be attempting to modify the kernel by loading a kernel module.
Then a process might be attempting to hack into your system.
Do
contact your security administrator and report this issue.

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that brctl should have the sys_module capability 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:
# grep brctl /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:brctl_t:s0-s0:c0.c1023
Target Context                system_u:system_r:brctl_t:s0-s0:c0.c1023
Target Objects                Unknown [ capability ]
Source                        brctl
Source Path                   /usr/sbin/brctl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bridge-utils-1.2-10.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40-4.fc15.x86_64 #1 SMP Fri
                              Jul 29 18:46:53 UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Sat 27 Aug 2011 12:17:26 PM CEST
Last Seen                     Sat 27 Aug 2011 12:17:26 PM CEST
Local ID                      362c4528-a173-4c48-b805-d05960ae676a

Raw Audit Messages
type=AVC msg=audit(1314440246.226:89): avc:  denied  { sys_module } for  pid=4266 comm="brctl" capability=16  scontext=system_u:system_r:brctl_t:s0-s0:c0.c1023 tcontext=system_u:system_r:brctl_t:s0-s0:c0.c1023 tclass=capability


type=SYSCALL msg=audit(1314440246.226:89): arch=x86_64 syscall=ioctl success=no exit=ENODEV a0=4 a1=8933 a2=7fff5237b770 a3=9 items=0 ppid=4185 pid=4266 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=brctl exe=/usr/sbin/brctl subj=system_u:system_r:brctl_t:s0-s0:c0.c1023 key=(null)

Hash: brctl,brctl_t,brctl_t,capability,sys_module

audit2allow

#============= brctl_t ==============
allow brctl_t self:capability sys_module;

audit2allow -R

#============= brctl_t ==============
allow brctl_t self:capability sys_module;

Comment 1 Henry Rust 2011-08-27 10:24:20 UTC
What I was doing:

Booted kernel 2.6.40 aka 3.0 with this grub.conf entry to enable Xen support:

title Fedora (2.6.40.3-0.fc15.x86_64) + Xen
        root (hd0,0)
        kernel /xen.gz
        module /vmlinuz-2.6.40-4.fc15.x86_64 ro root=/dev/mapper/vg_henrydesktop-lv_root rd_LVM_LV=vg_henrydesktop/lv_root rd_LVM_LV=vg_henrydesktop/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de iommu=noaperture rhgb quiet
        module /initramfs-2.6.40-4.fc15.x86_64.img

Xen came up successfully, checked with

xm dmesg | head -n 5
 __  __            _  _    _   _   ____     __      _ ____  
 \ \/ /___ _ __   | || |  / | / | |___ \   / _| ___/ | ___| 
  \  // _ \ '_ \  | || |_ | | | |__ __) | | |_ / __| |___ \ 
  /  \  __/ | | | |__   _|| |_| |__/ __/ _|  _| (__| |___) |
 /_/\_\___|_| |_|    |_|(_)_(_)_| |_____(_)_|  \___|_|____/ 

Next I tried to install a new small test VM with this command:

virt-install   --paravirt   --name=testvm   --ram=512   --vcpus=4   --disk path=/media/virt/Virtualization/testvm.img,size=10  --graphics vnc,port=5905 --noautoconsole   --autostart --noreboot   --location=http://mirrors.kernel.org/debian/dists/squeeze/main/installer-amd64/

Starting install...
Retrieving file MANIFEST...                                                                                                           | 3.3 kB     00:00 ... 
Retrieving file vmlinuz...                                                                                                            | 4.6 MB     00:06 ... 
Retrieving file initrd.gz...                                                                                                          |  37 MB     00:53 ... 
Allocating 'testvm.img'                                                                                                               |  10 GB     00:00     
ERROR    POST operation failed: xend_post: error from xen daemon: <Fault 3: 'testvm'>                                         0.0 B/s |    0 B     00:00     
Domain installation does not appear to have been successful.                                                                                                 
If it was, you can restart your domain by running:                                                                                                           
  virsh --connect xen:/// start testvm                                                                                                                       
otherwise, please restart your installation.                                                                   

And where I got the Selinux alert. What I basically did was following the following tutorial to get a Xen based VM up running on Fedora 15: http://rackerhacker.com/2011/08/05/xen-4-1-on-fedora-15-with-linux-3-0/

Comment 2 Miroslav Grepl 2011-08-29 09:12:19 UTC
Could you test it in permissive mode

# setenforce 0
# ausearch -m avc -ts recent

Comment 3 Daniel Walsh 2011-08-29 16:05:53 UTC
This looks like the infamous the kernel reports everyone who mentions a device driver as sys_module bug.

We probably need to dontaudit.

Comment 4 Fedora Update System 2011-11-16 16:16:33 UTC
selinux-policy-3.9.16-48.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-48.fc15

Comment 5 Fedora Update System 2011-11-17 23:34:56 UTC
Package selinux-policy-3.9.16-48.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.16-48.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16023/selinux-policy-3.9.16-48.fc15
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-12-04 02:34:35 UTC
selinux-policy-3.9.16-48.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.