Bug 366971 - parted print command crashes with Xen xvd disks
Summary: parted print command crashes with Xen xvd disks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: parted
Version: 5.1
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: David Cantrell
QA Contact: Brock Organ
URL:
Whiteboard:
: 254621 280181 (view as bug list)
Depends On:
Blocks: RHEL5u2_relnotes
TreeView+ depends on / blocked
 
Reported: 2007-11-05 16:06 UTC by Bryn M. Reeves
Modified: 2018-10-19 23:02 UTC (History)
5 users (show)

Fixed In Version: RHBA-2008-0322
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 16:55:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fix parted print command for xvd devices (805 bytes, patch)
2007-11-05 16:09 UTC, Bryn M. Reeves
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0322 0 normal SHIPPED_LIVE parted bug fix update 2008-05-20 13:21:04 UTC

Description Bryn M. Reeves 2007-11-05 16:06:58 UTC
Description of problem:
The parted patch to introduce XVD (xen virtual device) support doesn't update
the string table parted uses to print descriptions for different device types
("transports" in parted).

This causes parted to die with a message like this when run against an XVD device:

        [root@dhcp-5-79 ~]# parted /dev/xvda
        GNU Parted 1.8.1
        Using /dev/xvda
        Welcome to GNU Parted! Type 'help' to view a list of commands.
        (parted) p                                                               
        
        Model: Xen Virtual Block Device (
        
        You found a bug in GNU Parted! Here's what you have to do:
        
        Don't panic! The bug has most likely not affected any of your data.
        Help us to fix this bug by doing the following:
        
        Check whether the bug has already been fixed by checking
        the last version of GNU Parted that you can find at:
        
               http://ftp.gnu.org/gnu/parted/
        
        Please check this version prior to bug reporting.
        
        If this has not been fixed yet or if you don't know how to check,
        please visit the GNU Parted website:
        
               http://www.gnu.org/software/parted
        
        for further information.
        
        Your report should contain the version of this release (1.8.1)
        along with the error message below, the output of
        
               parted DEVICE unit co print unit s print
        
        and additional information about your setup you consider important.
        
        Error: SEGV_MAPERR (Address not mapped to object)Aborted (core dumped)

Running the suggested "parted DEVICE unit co print unit s print" command
causes parted to get stuck in a loop in strlen.

Disabling the segfault handler gives corrupted output of the device
description, pointing at a problem in the do_print function.

The do_print routine has a table mapping PED_DEVICE_* types to string
descriptions. This was not updated to include a description for XVD devices,
causing the routine to overshoot the end of the array and either segfault or
loop inside strlen (and then eventually segfault).

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. start parted with an xvd device on the commandline, e.g.:
   $ parted /dev/xvda
2. Run the print ("p") command
  
Actual results:
Parted dies with the above message. If the segfault handler is disabled output
appears but the device description is garbage.


Expected results:
Parted handles xvd devices properly and prints the partition table.

Additional info:

Comment 1 Bryn M. Reeves 2007-11-05 16:09:28 UTC
Created attachment 248381 [details]
fix parted print command for xvd devices

Fix the transport array in do_print:

-	 char*		 transport[13] = {"unknown", "scsi", "ide", "dac960",
+	 char*		 transport[14] = {"unknown", "scsi", "ide", "dac960",
					  "cpqarray", "file", "ataraid", "i2o",

-					  "ubd", "dasd", "viodasd", "sx8",
"dm"};
+					  "ubd", "dasd", "viodasd", "sx8",
"dm",
+					 "xvd"};

Comment 2 RHEL Program Management 2007-11-05 16:16:39 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Bryn M. Reeves 2007-11-08 09:32:00 UTC
Partner has tested & verified the patch in comment #1

Comment 5 David Cantrell 2007-12-19 04:15:06 UTC
*** Bug 254621 has been marked as a duplicate of this bug. ***

Comment 6 David Cantrell 2007-12-19 05:28:00 UTC
Fixed in parted-1.8.1-14.el5, moving to MODIFIED.

Comment 8 Chris Lalancette 2008-01-23 22:34:18 UTC
*** Bug 280181 has been marked as a duplicate of this bug. ***

Comment 11 Don Domingo 2008-02-21 00:05:12 UTC
added to RHEl5.2 release notes under "Resolved Issues":

<quote>
(ia64) Parted can now understand and correctly print out Xen Virtual Device
(XVD) partition labels. This enables paravirtualized guests to now use the
parted utility. As such, you no longer need to use parted within dom0 to
configure disk partitions on paravirtualized guests.
</quote>

please advise if any further revisions are required. thanks!


Comment 12 Bryn M. Reeves 2008-02-21 10:27:37 UTC
Does this need the "(ia64)" tag? The original problem in parted occurred
irrespective of architecture. (Sorry if I've misunderstood comment #11).

Comment 13 Aron Griffis 2008-02-21 20:47:58 UTC
The reason this has the ia64 tag is that parted is required on ia64, because
fdisk doesn't understand EFI GUID Partition Tables (aka GPT).  Most i386/x86_64
use DOS partition tables by default, so they're able to use fdisk.

However you're right, the bug would affect any architecture that uses GPT. 
Since there are x86_64 machines using EFI now, I suspect they're also using GPT
and would suffer from this bug.

Hope that helps.

Comment 14 Don Domingo 2008-02-21 22:56:54 UTC
Thanks Bryn, Aron. removed ia64 tag, release note will be available in all
architectures.

Comment 15 Stuart Sears 2008-02-22 11:12:26 UTC
This appears to be the underlying cause of #433950, which I opened probably
before searching for parted bugs. My fault, sorry. This breaks conga's storage
management  when using Xen VMs as cluster nodes.

Comment 16 Bryn M. Reeves 2008-02-26 10:05:34 UTC
Right, doesn't actually need any GPT in use - my tests were done with no GPT,
iirc. Stuart, if you want I can give you some test packages & you can confirm
bug 433950 is a dup of this one if you like?

Comment 17 Don Domingo 2008-04-02 02:17:37 UTC
Hi,
the RHEL5.2 release notes will be dropped to translation on April 15, 2008, at
which point no further additions or revisions will be entertained.

a mockup of the RHEL5.2 release notes can be viewed at the following link:
http://intranet.corp.redhat.com/ic/intranet/RHEL5u2relnotesmockup.html

please use the aforementioned link to verify if your bugzilla is already in the
release notes (if it needs to be). each item in the release notes contains a
link to its original bug; as such, you can search through the release notes by
bug number.

Cheers,
Don

Comment 20 errata-xmlrpc 2008-05-21 16:55:57 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 the 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-2008-0322.html



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