lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Feb 2020 13:09:33 +1100
From:   David Gibson <david@...son.dropbear.id.au>
To:     Rob Herring <robh@...nel.org>
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        Devicetree Compiler <devicetree-compiler@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH] libfdt: place new nodes & properties after the parent's
 ones

On Tue, Feb 11, 2020 at 02:29:22PM -0600, Rob Herring wrote:
> On Mon, Feb 10, 2020 at 5:44 PM David Gibson
> <david@...son.dropbear.id.au> wrote:
> >
> > On Mon, Feb 10, 2020 at 12:40:19PM +0100, Marek Szyprowski wrote:
> > > Hi David,
> > >
> > > On 05.02.2020 06:45, David Gibson wrote:
> > > > On Tue, Feb 04, 2020 at 01:58:44PM +0100, Marek Szyprowski wrote:
> > > >> While applying dt-overlays using libfdt code, the order of the applied
> > > >> properties and sub-nodes is reversed. This should not be a problem in
> > > >> ideal world (mainline), but this matters for some vendor specific/custom
> > > >> dtb files. This can be easily fixed by the little change to libfdt code:
> > > >> any new properties and sub-nodes should be added after the parent's node
> > > >> properties and subnodes.
> > > >>
> > > >> Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
> > > > I'm not convinced this is a good idea.
> > > >
> > > > First, anything that relies on the order of properties or subnodes in
> > > > a dtb is deeply, fundamentally broken.  That can't even really be a
> > > > problem with a dtb file itself, only with the code processing it.
> > >
> > > I agree about the properties, but generally the order of nodes usually
> > > implies the order of creation of some devices or objects.
> >
> > Huh?  From the device tree client's point of view the devices just
> > exist - the order of creation should not be visible to it.
> 
> I'm not sure if downstream is different, but upstream this stems from
> Linux initcalls being processed in link order within a given level.
> It's much better than it used to be, but short of randomizing the
> ordering, I'm not sure we'll ever find and fix all these hidden
> dependencies.

Uhh... I don't really see how that relates to device tree encoding
order.  That's another source of non-stable device identifications,
which dtb order can also be, but they're not really connected beyond
that as far as I can tell.

> > > This sometimes
> > > has some side-effects.
> >
> > If those side effects matter, your code is broken.  If you need to
> > apply an order to nodes, you should be looking at 'reg' or other
> > properties.
> 
> The general preference is to sort by 'reg'. And we try to catch and
> reject any node re-ordering patches.
> 
> Rob
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ