GNU bug report logs - #32119
Parted molests system firmware partitions.

Previous Next

Package: parted;

Reported by: "Laurence Perkins (OE)" <lperkins <at> openeye.net>

Date: Tue, 10 Jul 2018 18:35:01 UTC

Severity: normal

To reply to this bug, email your comments to 32119 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#32119; Package parted. (Tue, 10 Jul 2018 18:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Laurence Perkins (OE)" <lperkins <at> openeye.net>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Tue, 10 Jul 2018 18:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Laurence Perkins (OE)" <lperkins <at> openeye.net>
To: "bug-parted <at> gnu.org" <bug-parted <at> gnu.org>
Subject: Parted molests system firmware partitions.
Date: Tue, 10 Jul 2018 18:27:30 +0000
A few of the cheaper devices I work with have the system firmware, the
RPMB, and the primary block device all backed by the same onboard eMMC
flash chip.  The special ones show up as /dev/mmcblk1boot0 and
/dev/mmcblk1rpmb respectively.

The kernel drivers for the eMMC device automatically detect this
situation and write-protect these special devices unless you
specifically enable writes via a switch in /proc.


Calling parted -l however attempts to open these devices read-write. 
Which fails and generates a dmesg entry that, prior to the 4.14 kernel,
was difficult to distinguish from the messages generated by a failing
eMMC device.

To keep the logs clean and for safety in the case of someone enabling
writes to these devices for various reasons, parted should probably do
what it can to leave them alone unless specifically instructed to do
otherwise.  Poking these devices in the wrong way can potentially brick
the motherboard, so an extra layer of defense around them would seem
prudent.

For my own purposes I will simply remove these device nodes from my
system as I have no need of them, so I do not personally consider this
to be a critical issue.  Those who actually make use of these special
devices may disagree though.

https://dev-nell.com/rpmb-emmc-errors-under-linux.html documents a
different issue, but has some code references that may be useful for
determining how best to construct a filter for these special devices.

LMP



Information forwarded to bug-parted <at> gnu.org:
bug#32119; Package parted. (Thu, 19 Jul 2018 22:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 32119 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: "Laurence Perkins (OE)" <lperkins <at> openeye.net>
Cc: 32119 <at> debbugs.gnu.org
Subject: Re: bug#32119: Parted molests system firmware partitions.
Date: Thu, 19 Jul 2018 15:24:04 -0700
On Tue, Jul 10, 2018 at 06:27:30PM +0000, Laurence Perkins (OE) wrote:
> Calling parted -l however attempts to open these devices read-write. 
> Which fails and generates a dmesg entry that, prior to the 4.14 kernel,
> was difficult to distinguish from the messages generated by a failing
> eMMC device.

Which version of parted are you using and does it include this patch:

https://github.com/bcl/parted/commit/44d5ae0115c4ecfe3158748309e9912c5aede92d

That should prevent partprobe and parted -l from opening it R/W when it
doesn't need to.

-- 
Brian C. Lane (PST8PDT)




Information forwarded to bug-parted <at> gnu.org:
bug#32119; Package parted. (Thu, 19 Jul 2018 22:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 32119 <at> debbugs.gnu.org (full text, mbox):

From: "Laurence Perkins (OE)" <lperkins <at> openeye.net>
To: "bcl <at> redhat.com" <bcl <at> redhat.com>
Cc: "32119 <at> debbugs.gnu.org" <32119 <at> debbugs.gnu.org>
Subject: Re: bug#32119: Parted molests system firmware partitions.
Date: Thu, 19 Jul 2018 22:56:37 +0000

On Thu, 2018-07-19 at 15:24 -0700, Brian C. Lane wrote:
> On Tue, Jul 10, 2018 at 06:27:30PM +0000, Laurence Perkins (OE)
> wrote:
> > Calling parted -l however attempts to open these devices read-
> > write. 
> > Which fails and generates a dmesg entry that, prior to the 4.14
> > kernel,
> > was difficult to distinguish from the messages generated by a
> > failing
> > eMMC device.
> 
> Which version of parted are you using and does it include this patch:
> 
> https://github.com/bcl/parted/commit/44d5ae0115c4ecfe3158748309e9912c
> 5aede92d
> 
> That should prevent partprobe and parted -l from opening it R/W when
> it
> doesn't need to.
> 

I'm running parted 3.2, which appears to be the latest available
release on the gnu.org ftp site, as well as in my distribution
(Gentoo).  However it's also older than that commit, so it probably
does not have it.  

Is there some super-secret release that's less than four years old that
I'm just not managing to find? Or have distros just been applying
patches themselves and continuing to call it 3.2?  There are some
unstable packages I could try if that's the case just to see if they've
pulled that commit in.

If not I'll try building it my self when I get a chance.

LMP



Information forwarded to bug-parted <at> gnu.org:
bug#32119; Package parted. (Fri, 20 Jul 2018 00:57:01 GMT) Full text and rfc822 format available.

Message #14 received at 32119 <at> debbugs.gnu.org (full text, mbox):

From: "Laurence Perkins (OE)" <lperkins <at> openeye.net>
To: "bcl <at> redhat.com" <bcl <at> redhat.com>
Cc: "32119 <at> debbugs.gnu.org" <32119 <at> debbugs.gnu.org>
Subject: Re: bug#32119: Parted molests system firmware partitions.
Date: Fri, 20 Jul 2018 00:56:43 +0000

On Thu, 2018-07-19 at 15:24 -0700, Brian C. Lane wrote:
> On Tue, Jul 10, 2018 at 06:27:30PM +0000, Laurence Perkins (OE)
> wrote:
> > Calling parted -l however attempts to open these devices read-
> > write. 
> > Which fails and generates a dmesg entry that, prior to the 4.14
> > kernel,
> > was difficult to distinguish from the messages generated by a
> > failing
> > eMMC device.
> 
> Which version of parted are you using and does it include this patch:
> 
> https://github.com/bcl/parted/commit/44d5ae0115c4ecfe3158748309e9912c
> 5aede92d
> 
> That should prevent partprobe and parted -l from opening it R/W when
> it
> doesn't need to.
> 

The latest version available for Gentoo (or Debian as far as I can see)
does not contain that commit.

I pulled the repo you linked and tested it.  It also still generates
the error messages in the kernel log.  I had assumed that the problem
was opening the device read/write due to the wording of the dmesg error
from kernel 4.14.  This may have been a premature assumption on my
part.  (Or maybe not, see below.)

Running parted -l or partprobe with the version from the above repo
results in:

Warning: Error fsyncing/closing /dev/mmcblk1rpmb: Input/output error

Interestingly the 3.2 release version prints the user error twice and
the dmesg error three times while the version from the above repo only
prints the user error once and the dmesg error twice.  So it's also
possible that this commit had some effect but the program goes on to
open the device read/write a couple of times anyway.

If you need access to a device with an rpmb for testing anything, let
me know.  I can probably arrange it.

LMP





Information forwarded to bug-parted <at> gnu.org:
bug#32119; Package parted. (Wed, 22 Aug 2018 13:04:02 GMT) Full text and rfc822 format available.

Message #17 received at 32119 <at> debbugs.gnu.org (full text, mbox):

From: Phillip Susi <psusi <at> ubuntu.com>
To: "Laurence Perkins (OE)" <lperkins <at> openeye.net>,
 "bcl <at> redhat.com" <bcl <at> redhat.com>
Cc: "32119 <at> debbugs.gnu.org" <32119 <at> debbugs.gnu.org>
Subject: Re: bug#32119: Parted molests system firmware partitions.
Date: Wed, 22 Aug 2018 09:03:49 -0400
[Message part 1 (text/plain, inline)]
On 7/19/2018 6:56 PM, Laurence Perkins (OE) wrote:
> I'm running parted 3.2, which appears to be the latest available
> release on the gnu.org ftp site, as well as in my distribution
> (Gentoo).  However it's also older than that commit, so it probably
> does not have it.  

Yea, we really need to release 3.3 already.  Brian, do you know of
anything that still needs merged or fixed before we do that?


[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.