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 2116505 - Partition type may be unexpectedly changed when using libparted
Summary: Partition type may be unexpectedly changed when using libparted
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: parted
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-08 16:19 UTC by Brian Lane
Modified: 2022-11-15 13:13 UTC (History)
1 user (show)

Fixed In Version: parted-3.5-2.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 11:19:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
reproducer source (3.25 KB, text/x-csrc)
2022-08-09 22:50 UTC, Brian Lane
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-130530 0 None None None 2022-08-08 16:30:00 UTC
Red Hat Issue Tracker RTT-4742 0 None None None 2022-08-10 08:42:36 UTC
Red Hat Issue Tracker RTT-4743 0 None None None 2022-08-10 08:42:40 UTC
Red Hat Product Errata RHBA-2022:8342 0 None None None 2022-11-15 11:19:35 UTC

Description Brian Lane 2022-08-08 16:19:30 UTC
Description of problem:
parted 3.5 changed the way that flags are handled in order to support the ability to set arbitrary partition types and guids. In normal use there should be no issues, but if a user of the library calls ped_partition_set_system after the initial partition setup the partition type will be changed to the default for the filesystem, possibly removing the type set based on the flags.

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


Additional info:

Currently working on a fix for this, will update when it is available.

Comment 2 Brian Lane 2022-08-09 22:50:14 UTC
Created attachment 1904583 [details]
reproducer source

Here's a small C program to test for the problem.

Install gcc and parted's header files:

dnf install -y gcc parted-devel

Create 2 disk image files:

fallocate -l 10M disk-gpt.img
fallocate -l 10M disk-msdos.img

Build the test, linking to parted:

gcc -lparted test-set_system.c -o run-test

./run-test

On parted 3.5-1 the output will have all of the flags set to OFF.

When the bug is fixed the output will have bios_grub ON for gpt and bls_boot ON for msdos.

Comment 6 Jan Stodola 2022-08-16 15:45:02 UTC
[root@localhost ~]# rpm -q parted
parted-3.5-2.el9.x86_64
[root@localhost ~]# gcc -lparted test-set_system.c -o run-test
[root@localhost ~]# ./run-test

== GPT
fs_type = ext4
           boot = OFF
           root = OFF
           swap = OFF
         hidden = OFF
           raid = OFF
            lvm = OFF
            lba = OFF
     hp-service = OFF
           palo = OFF
           prep = OFF
        msftres = OFF
      bios_grub = ON
        atvrecv = OFF
           diag = OFF
    legacy_boot = OFF
       msftdata = OFF
           irst = OFF
            esp = OFF
chromeos_kernel = OFF
       bls_boot = OFF
     linux-home = OFF

== MSDOS
fs_type = ext4
           boot = OFF
           root = OFF
           swap = OFF
         hidden = OFF
           raid = OFF
            lvm = OFF
            lba = OFF
     hp-service = OFF
           palo = OFF
           prep = OFF
        msftres = OFF
      bios_grub = OFF
        atvrecv = OFF
           diag = OFF
    legacy_boot = OFF
       msftdata = OFF
           irst = OFF
            esp = OFF
chromeos_kernel = OFF
       bls_boot = ON
     linux-home = OFF
[root@localhost ~]#


Marking as Verified:Tested

Comment 10 Jan Stodola 2022-08-18 15:32:45 UTC
Checked that parted-3.5-2.el9 is in nightly compose RHEL-9.1.0-20220817.6

Moving to VERIFIED

Comment 12 errata-xmlrpc 2022-11-15 11:19:34 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 (parted bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8342


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