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 698085 - virt-install:set static security label not take effect for guest
Summary: virt-install:set static security label not take effect for guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-20 07:07 UTC by zhe peng
Modified: 2011-12-06 16:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Specifying a static selinux label via virt-install did not build a correct guest configuration. Consequence: The static selinux label did not take effect for the guest. Fix: Generate correct configuration Result: Static labels work
Clone Of:
Environment:
Last Closed: 2011-12-06 16:16:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1643 0 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-12-06 00:50:36 UTC

Description zhe peng 2011-04-20 07:07:56 UTC
Description of problem:
set static security label not take effect for guest

Version-Release number of selected component (if applicable):
python-virtinst-0.500.5-3.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.# virt-install -n demo -r 512 -f /tmp/img/rhel6_x86_64_qcow2.img --import --security type=static,label='system_u:object_r:svirt_image_t:s0:c100,c200'

2.#virsh dumpxml demo

  
Actual results:
........
<seclabel type='dynamic' model='selinux'>
    <label>system_u:system_r:svirt_t:s0:c67,c414</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c67,c414</imagelabel>
  </seclabel>
........

Expected results:
security type should be 'static', and the label is same with settings by user.


Additional info:

Comment 1 Cole Robinson 2011-06-10 19:45:25 UTC
Please provide the output of virt-install --debug (also please do so for any future virt-* bug reports)

Comment 2 Cole Robinson 2011-06-10 19:51:37 UTC
Actually, I can reproduce, so no need for --debug output

Comment 4 Cole Robinson 2011-07-28 15:34:30 UTC
Fixed in python-virtinst-0.600.0-1.el6

Comment 6 Huming Jiang 2011-08-02 08:51:54 UTC
Could still reproduce this bug in the following componets:
python-virtinst-0.600.0-1.el6.
libvirt-0.9.4-0rc1.el6.x86_64
kernel-2.6.32-171.el6.x86_64
qemu-kvm-0.12.1.2-2.174.el6.x86_64
How reproducible:
always

Steps to Reproduce:

# virt-install -n demo -r 512 -f /var/lib/libvirt/images/demo.img -s 5 -c /dev/cdrom  --security type=static,label='system_u:object_r:svirt_image_t:s0:c100,c200'

Starting install...
ERROR    internal error Process exited while reading console log output: libvir: error : cannot execute binary /usr/libexec/qemu-kvm: Permission denied

Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start demo
otherwise, please restart your installation.

Comment 7 Huming Jiang 2011-08-02 09:11:12 UTC
(In reply to comment #6)
> Could still reproduce this bug in the following componets:
> python-virtinst-0.600.0-1.el6.
> libvirt-0.9.4-0rc1.el6.x86_64
> kernel-2.6.32-171.el6.x86_64
> qemu-kvm-0.12.1.2-2.174.el6.x86_64
> How reproducible:
> always
> 
> Steps to Reproduce:

When i reproduced this bug use the above packages, I met the following problem, so whether this bug has been fixed or not is unknown for me(Sorry for comment 6 ). The following error message is a new problem about this bug. So set the bug status to ASSIGNED.


> 
> # virt-install -n demo -r 512 -f /var/lib/libvirt/images/demo.img -s 5 -c
> /dev/cdrom  --security
> type=static,label='system_u:object_r:svirt_image_t:s0:c100,c200'
> 
> Starting install...
> ERROR    internal error Process exited while reading console log output:
> libvir: error : cannot execute binary /usr/libexec/qemu-kvm: Permission denied
> 
> Domain installation does not appear to have been successful.
> If it was, you can restart your domain by running:
>   virsh --connect qemu:///system start demo
> otherwise, please restart your installation.

Comment 8 Cole Robinson 2011-08-02 14:55:57 UTC
The initial report said that even if the user specified --security type=static we would still generate XML with type=dynamic. You should be able to confirm that virt-install did the correct thing by specifying --debug and checking that the generated XML has <seclabel type='static' in it.

That said, there might be other issues here, but those would be separate bugs.

Comment 9 Huming Jiang 2011-08-03 10:36:02 UTC
verified with the following components:
python-virtinst-0.600.0-2.el6.noarch
libvirt-0.9.4-0rc1.2.el6.x86_64
qemu-kvm-0.12.1.2-2.175.el6.x86_64
kernel-2.6.32-171.el6.x86_64

Steps:
1.chcon system_u:object_r:svirt_image_t:s0:c100,c200 /var/lib/libvirt/images/test.img
2. virt-install -n test -r 512 -f /var/lib/libvirt/images/test.img --import --security type=static,label='system_u:system_r:svirt_t:s0:c100,c200' --debug

...
  <seclabel type='static' model='selinux' relabel='no'>
    <label>system_u:system_r:svirt_t:s0:c100,c200</label>
  </seclabel>
...

3. virsh dumpxml test

...
  <seclabel type='static' model='selinux' relabel='no'>
    <label>system_u:system_r:svirt_t:s0:c100,c200</label>
  </seclabel>
...

Comment 10 Cole Robinson 2011-11-07 17:14:54 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:
Specifying a static selinux label via virt-install did not build a correct guest configuration.

Consequence:
The static selinux label did not take effect for the guest.

Fix:
Generate correct configuration

Result:
Static labels work

Comment 11 errata-xmlrpc 2011-12-06 16:16:52 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-2011-1643.html


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