After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 721988 - Crash when creating new partition on disk with loop label
Crash when creating new partition on disk with loop label
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2014-01-11 13:21 UTC by Mike Fleetwood
Modified: 2014-02-19 17:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Prevent crash when creating new partition on loop label (v1) (2.26 KB, patch)
2014-01-11 15:44 UTC, Mike Fleetwood
none Details | Review
Prevent crash when creating new partition on loop label (v2) (2.24 KB, patch)
2014-01-12 08:46 UTC, Mike Fleetwood
none Details | Review
Prevent crash when creating new partition on loop label (v3) (2.24 KB, patch)
2014-01-12 21:25 UTC, Curtis Gedak
none Details | Review

Description Mike Fleetwood 2014-01-11 13:21:52 UTC
While doing some testing I found this new way to crash GParted.

1) Write a new partition table of type loop to a disk;
2) Create a new partition on it.

It effects GParted >= 0.16.2 with all versions of libparted.
(Unless you have (lib)parted > 3.1 from the GIT repo [1] with
Phillip Susi's pending patch [2] applied to fix loop labels).

[1] GNU Parted GIT repository
    http://git.savannah.gnu.org/cgit/parted.git
[2] bug#16231: [PATCH 1/2] Fix loop labels
    http://lists.gnu.org/archive/html/bug-parted/2014-01/msg00001.html

I'm working on the fix.

Thanks,
Mike
Comment 1 Mike Fleetwood 2014-01-11 15:44:29 UTC
Created attachment 266003 [details] [review]
Prevent crash when creating new partition on loop label (v1)

Hi Curtis,

Here's the fix for this bug.

Note that with this fix applied GParted returns to reporting an error
for this test case, rather than crashing, just as it did for
GParted <= 0.16.1, before this commit was applied:

    Clear btrfs file system super block mirror copies too (#705426)
    https://git.gnome.org/browse/gparted/commit/?id=246e05559d91865dd135690a62d56144f375c26b

Addressing the "unrecognised disk label" error from libparted is what
bug 683643 "Doesn't properly support partitionless drives" is all about.

Thanks,
Mike
Comment 2 Mike Fleetwood 2014-01-12 08:46:13 UTC
Created attachment 266053 [details] [review]
Prevent crash when creating new partition on loop label (v2)

Hi Curtis,

Here's v2 of the patch.  Only changes the commit message a bit.

Thanks,
Mike
Comment 3 Curtis Gedak 2014-01-12 21:25:07 UTC
Created attachment 266083 [details] [review]
Prevent crash when creating new partition on loop label (v3)

Hi Mike,

Thank you for discovering this crash situation and developing a patch.

I was able to confirm the crash using GParted 0.17.0 to write a loop "partition table" to a disk device, and then trying to write a file system to the loop device.

Using your patch (v2) I was able to confirm that the patch prevents GParted from crashing and instead permits display of a libparted error.

The attached updated patch contains a minor change to the commit message.  Specifically it changes:

  "the the"  -->   "to the"

This patch (v3) passes my review.  If you are content with the patch then please feel free to commit it to the master branch of the gnome git repository.

Curtis
Comment 4 Mike Fleetwood 2014-01-13 08:12:33 UTC
Hi Curtis,

I've pushed the patch to the GParted GIT repository.  Patch details:

Prevent crash when creating new partition on loop label (#721988)
https://git.gnome.org/browse/gparted/commit/?id=0e253fa234a16651e4c334b9599df016e7ed0cc7

Thanks,
Mike
Comment 5 Curtis Gedak 2014-02-19 17:51:14 UTC
This enhancement was included in the GParted 0.18.0 release on February 19,
2014.