Bug 658712

Summary: xend: Add syntax check for block devices
Product: Red Hat Enterprise Linux 5 Reporter: Yufang Zhang <yuzhang>
Component: xenAssignee: Xen Maintainance List <xen-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6CC: leiwang, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: xen-3.0.3-122.el5 Doc Type: Bug Fix
Doc Text:
Previously, the xend daemon did not perform syntax checks for block devices either in configuration files or on the command line. As a consequence, the guest was exposed to a kernel panic or the "xm block-attach" command failed. With this update, a patch has been provided, and xend now checks the format of block device entries and parameters before adding the information into XenStore storage space, fixing these issues.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 09:15:58 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:
Attachments:
Description Flags
patch for this bug none

Description Yufang Zhang 2010-12-01 03:33:28 UTC
Description of problem:
Xend should do syntax check for block devices for either config file(using when create guest ) and command line(using when attach disk to guest), otherwise guest would expose to kernel panic or can not see the attached disk. Such as:

1. disk = ['files:/xen-autotest/images/RHEL-Server-5.5-64-pv.raw,xvda,w']
2. disk = [':/xen-autotest/images/RHEL-Server-5.5-64-pv.raw,xvda,w']
3. disk = ['/xen-autotest/images/RHEL-Server-5.5-64-pv.raw,xvda,w']
4. # xm block-attach vm1 /xen-autotest/images/RHEL-Server-5.5-64-pv.raw xvdc:disk r

Version-Release number of selected component (if applicable):
xen-3.0.3-120.el5

How reproducible:
Always

Steps to Reproduce:
Please refer to Description.
  
Actual results:
Guest panics or block-attach fails.

Expected results:
xend check the syntax and report warnings. 

Additional info:
A patch in upstream would fix this problem. It would be back-ported into RHEL soon.

Comment 1 Yufang Zhang 2010-12-01 03:38:01 UTC
Created attachment 463883 [details]
patch for this bug

This is the patch back-ported from upstream. It does syntax check before adding information into xenstore.

Comment 3 RHEL Program Management 2011-01-11 19:50:22 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2011-01-12 15:22:33 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 8 Yufang Zhang 2011-03-18 06:43:03 UTC
QA verified this bug on xen-3.0.3-126.el5:

1. Create a guest with error block device syntax, like:

disk = ['files:/xen-autotest/images/RHEL-Server-5.5-64-pv.raw,xvda,w']

or 

disk = [':/xen-autotest/images/RHEL-Server-5.5-64-pv.raw,xvda,w']

xend checks the error and prevent you from creating the guest.

2. Try to attach a block device to a PV guest, with a wrong format, like: 

# xm block-attach vm1 /xen-autotest/images/RHEL-Server-5.5-64-pv.raw xvdc:disk r

xend/xm output shows that the syntax is error.

So change this bug to VERIFIED.

Comment 9 Tomas Capek 2011-07-13 13:21:57 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:
Previously, the xend daemon did not perform syntax checks for block devices either in configuration files or on the command line. As a consequence, the guest was exposed to a kernel panic or the "xm block-attach" command failed. With this update, a patch has been provided, and xend now checks the format of block device entries and parameters before adding the information into XenStore storage space, fixing these issues.

Comment 10 errata-xmlrpc 2011-07-21 09:15:58 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1070.html

Comment 11 errata-xmlrpc 2011-07-21 11:59:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1070.html