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 1007761 - Segmentation fault when argument 'partnum' of part-get-gpt-type is too large
Summary: Segmentation fault when argument 'partnum' of part-get-gpt-type is too large
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gdisk
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Tomáš Bžatek
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On: 1007847
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-13 09:32 UTC by bfan
Modified: 2015-03-03 23:06 UTC (History)
5 users (show)

Fixed In Version: gdisk-0.8.6-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1007847 (view as bug list)
Environment:
Last Closed: 2014-06-13 10:02:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description bfan 2013-09-13 09:32:00 UTC
Description of problem:
when partnum >= 1185, part-get-gpt-type will give an error.

libguestfs: error: part_get_gpt_type: sgdisk /dev/sda -i 1185: *** Segmentation fault
Register dump:

 RAX: 0000000000000000   RBX: 00000000019e6018   RCX: 0000000035383131
 RDX: 0000000000353831   RSI: 0000000000000200   RDI: 00000000019e6018
 RBP: 0000000000000000   R8 : 0000000000000000   R9 : 0000000000000002
...

but guestfish is still alive. It looks like a bug of sgdisk

 
Version-Release number of selected component (if applicable):
libguestfs-1.22.6-5.el7.x86_64
gdisk-0.8.6-1.el7.x86_64


How reproducible:
100%

 
Steps to Reproduce:
# guestfish -N fs part-disk /dev/sda gpt : part-get-gpt-type /dev/sda 1185


Actual result:
Gives a "Segmentation fault" error


Expect result:
Not return "Segmentation fault"


Additional info:
I tried "sgdisk /dev/sda -i 1185" in linux, it failed
# sgdisk /dev/sda -i 1185

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
***************************************************************

Segmentation fault (core dumped)

Comment 1 Richard W.M. Jones 2013-09-13 12:58:06 UTC
You were right that this is a bug in gdisk.  Easily
reproducible on the command line:

$ sgdisk /dev/sda -i 1185

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Segmentation fault (core dumped)

The stack trace is:

Program received signal SIGSEGV, Segmentation fault.
GPTPart::ShowDetails (this=0x851018, blockSize=512) at gptpart.cc:210
210	   if (firstLBA != 0) {
(gdb) bt
#0  GPTPart::ShowDetails (this=0x851018, blockSize=512) at gptpart.cc:210
#1  0x000000000041015e in GPTData::ShowPartDetails (
    this=this@entry=0x7fffffffc470, partNum=<optimized out>) at gpt.cc:1406
#2  0x00000000004193d1 in GPTDataCL::DoOptions (
    this=this@entry=0x7fffffffc470, argc=argc@entry=4, 
    argv=argv@entry=0x7fffffffde48) at gptcl.cc:255
#3  0x0000000000402dd6 in main (argc=4, argv=0x7fffffffde48) at sgdisk.cc:20

Comment 2 Tomáš Bžatek 2013-09-26 12:28:19 UTC
Backported changes from bug 1007847 and built gdisk-0.8.6-2.el7

Comment 5 Ludek Smid 2014-06-13 10:02:38 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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