RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 947387 - Running domain may disappear after libvirtd is restarted when selinux security driver is disabled
Summary: Running domain may disappear after libvirtd is restarted when selinux securit...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1106440
TreeView+ depends on / blocked
 
Reported: 2013-04-02 10:08 UTC by Michal Privoznik
Modified: 2014-06-09 11:18 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.2-20.el6
Doc Type: Bug Fix
Doc Text:
Cause: Libvirt uses an side files to store the internal state of managed domains in order to re-read the state upon libvirtd service restart. However, if the state was saved in inconsistent state, the state wasn't re-read and the corresponding domain was lost. Consequence: The domain may disappear. Fix: When the libvirtd service is saving the internal state of a domain, the consistent internal state is saved and domains which may break it are disallowed to be started up. Result: The domain is not longer frogotten.
Clone Of:
: 1106440 (view as bug list)
Environment:
Last Closed: 2013-11-21 08:58:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1581 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2013-11-21 01:11:35 UTC

Description Michal Privoznik 2013-04-02 10:08:36 UTC
Description of problem:
If a domain with selinux seclabel is started on a host with selinux disabled, it will disapper after libvirtd service restart.

Version-Release number of selected component (if applicable):
libvirt.x86_64 0:0.10.2-18.el6_4.3  

How reproducible:
100%

Steps to Reproduce:
1. set security_driver = "none" in /etc/libvirt/qemu.conf (or alternatively disable SELinux on the host)
2. restart libvirtd service (or the host in case the alternative route in step 1 was chosen)
3. start a domain which contains <seclabel type='dynamic' model='selinux' relabel='yes'/> in its XML configuration
4. restart libvirtd
5. domain is lost (or in shutoff state in case of persistent domain)
  
Actual results:
Domain disappers from 'virsh list' (or is shown as shut off)


Expected results:
Domain does not disappar (or is shown as running).

Additional info:
This is the behaviour that has been around for ages. However, we'd interchanged this for Bug 923946 which reports slightly different problem.

Comment 1 Michal Privoznik 2013-04-03 08:42:22 UTC
Moving to POST:

commit 8d68cbeaa8a64759323da1d64526e2a941eb93e1
Author:     Michal Privoznik <mprivozn>
AuthorDate: Tue Apr 2 17:49:34 2013 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Wed Apr 3 10:19:46 2013 +0200

    sec_manager: Refuse to start domain with unsupported seclabel
    
    https://bugzilla.redhat.com/show_bug.cgi?id=947387
    
    If a user configures a domain to use a seclabel of a specific type,
    but the appropriate driver is not accessible, we should refuse to
    start the domain. For instance, if user requires selinux, but it is
    either non present in the system, or is just disabled, we should not
    start the domain. Moreover, since we are touching only those labels we
    have a security driver for, the other labels may confuse libvirt when
    reconnecting to a domain on libvirtd restart. In our selinux example,
    when starting up a domain, missing security label is okay, as we
    auto-generate one. But later, when libvirt is re-connecting to a live
    qemu instance, we parse a state XML, where security label is required
    and it is an error if missing:
    
      error : virSecurityLabelDefParseXML:3228 : XML error: security label
      is missing
    
    This results in a qemu process left behind without any libvirt control.

v1.0.4-22-g8d68cbe

Comment 9 Michal Privoznik 2013-07-12 07:36:21 UTC
Huh, for some reason this bug was in POST, but the patch hasn't been backported. So here's the patch:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-July/msg00332.html

Comment 11 yanbing du 2013-07-16 05:37:55 UTC
# rpm -q libvirt
libvirt-0.10.2-20.el6.x86_64

Following the reproduce steps in comment 0
when start the guest, get expect error
# virsh start virtlab_test
error: Failed to start domain virtlab_test
error: unsupported configuration: Unable to find security driver for label selinux

So this bug can VERIFIED.

BTW, if remove the configuration: security_driver = "none", restart libvirtd, when start the domain, libvirtd will crash, there's a new bug 984793 to track this problem.

Comment 13 errata-xmlrpc 2013-11-21 08:58:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1581.html


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