Bug 753395 - virsh iface-start and iface-destroy commands lead to a "very long wait" before finally succeeding
Summary: virsh iface-start and iface-destroy commands lead to a "very long wait" befor...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 753396
TreeView+ depends on / blocked
 
Reported: 2011-11-12 08:17 UTC by Laine Stump
Modified: 2011-11-21 00:00 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.10.0-56.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 753396 (view as bug list)
Environment:
Last Closed: 2011-11-21 00:00:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Laine Stump 2011-11-12 08:17:03 UTC
Description of problem:

With "setenforce enforcing" and NetworkManager enabled, any use of libvirt's "virsh iface-start" or "virsh iface-destroy" commands leads to a very long delay (didn't time it, but at least one minute) before the command finally succeeds. During this time, /var/log/audit/audit.log shows the following AVC about once per second:

type=USER_AVC msg=audit(1321058847.893:372): user pid=1906 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { send_msg } for msgtype=method_return dest=:1.103 spid=1917 tpid=10568 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:system_r:virtd_t:s0-s0:c0.c1023 tclass=dbus : exe="/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'

How reproducible: 100%


Steps to Reproduce:
1. enable NetworkManager (may not be necessary, haven't checked)
2. setenforce enforcing
3. virsh iface-destroy [some interface you can live without for a minute]
  
Actual results:

Very long wait before success

Expected results:

Success within a few seconds (may take several seconds if using DHCP on the interface)

Additional info:

virsh iface-start and virsh iface-destroy are simply calling functions in the netcf library that exec /sbin/ifup and /sbin/ifdown. These shell scripts then call nmcli to do the actual work. dbus-daemon then at some point tries to send a message to nmcli. For some reason, rather than failing immediately, it retries about once a second for a long time, and then the operation succeeds anyway (not the send-msg, but the higher level "ifup/ifdown" operation).

ncftool has similar commands "ncftool ifup" and "ncftool ifdown" which succeed immediately as expected.

On eparis' advice, I created the following temporary policy module, which fixed the problem on my system:

module nmvirttemp 1.0;

require {
	type virtd_t;
	type NetworkManager_t;
	class dbus send_msg;
}

#============= NetworkManager_t ==============
allow NetworkManager_t virtd_t:dbus send_msg;

After discovering this problem on F16, I checked my F14 box and it has the same problem, so I assume it's also a problem on F14. I'm not sure when this crept in - I always run all my boxes with selinux enforcing, but hadn't done anything with these functions recently.

Comment 1 Miroslav Grepl 2011-11-14 11:18:10 UTC
Fixed in selinux-policy-3.10.0-56.fc16

Comment 2 Fedora Update System 2011-11-16 15:22:54 UTC
selinux-policy-3.10.0-56.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-56.fc16

Comment 3 Fedora Update System 2011-11-17 23:30:36 UTC
Package selinux-policy-3.10.0-56.fc16:
* should fix your issue,
* was pushed to the Fedora 16 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.10.0-56.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16003/selinux-policy-3.10.0-56.fc16
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2011-11-21 00:00:45 UTC
selinux-policy-3.10.0-56.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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