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] [day] [month] [year] [list]
Message-ID: <Y2CW3/V4/iiMh+Sq@COLIN-DESKTOP1.localdomain>
Date:   Mon, 31 Oct 2022 20:47:43 -0700
From:   Colin Foster <colin.foster@...advantage.com>
To:     Rob Herring <robh@...nel.org>
Cc:     Vladimir Oltean <olteanv@...il.com>,
        linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        John Crispin <john@...ozen.org>,
        Sean Wang <sean.wang@...iatek.com>,
        DENG Qingfang <dqfext@...il.com>,
        Landen Chao <Landen.Chao@...iatek.com>,
        nç ÜNAL <arinc.unal@...nc9.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        "David S. Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Lee Jones <lee@...nel.org>
Subject: Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize
 shared dsa.yaml

On Mon, Oct 31, 2022 at 10:44:09AM -0500, Rob Herring wrote:
> On Thu, Oct 27, 2022 at 04:25:53AM +0300, Vladimir Oltean wrote:
> > Hi Rob,
> > 
> > On Tue, Oct 25, 2022 at 04:21:14PM -0500, Rob Herring wrote:
> > > On Mon, Oct 24, 2022 at 10:03:51PM -0700, Colin Foster wrote:
> > > > The dsa.yaml binding contains duplicated bindings for address and size
> > > > cells, as well as the reference to dsa-port.yaml. Instead of duplicating
> > > > this information, remove the reference to dsa-port.yaml and include the
> > > > full reference to dsa.yaml.
> > > 
> > > I don't think this works without further restructuring. Essentially, 
> > > 'unevaluatedProperties' on works on a single level. So every level has 
> > > to define all properties at that level either directly in 
> > > properties/patternProperties or within a $ref.
> > > 
> > > See how graph.yaml is structured and referenced for an example how this 
> > > has to work.
> > > 
> > > > @@ -104,8 +98,6 @@ patternProperties:
> > > >                SGMII on the QCA8337, it is advised to set this unless a communication
> > > >                issue is observed.
> > > >  
> > > > -        unevaluatedProperties: false
> > > > -
> > > 
> > > Dropping this means any undefined properties in port nodes won't be an 
> > > error. Once I fix all the issues related to these missing, there will be 
> > > a meta-schema checking for this (this could be one I fixed already).
> > 
> > I may be misreading, but here, "unevaluatedProperties: false" from dsa.yaml
> > (under patternProperties: "^(ethernet-)?port@[0-9]+$":) is on the same
> > level as the "unevaluatedProperties: false" that Colin is deleting.
> > 
> > In fact, I believe that it is precisely due to the "unevaluatedProperties: false"
> > from dsa.yaml that this is causing a failure now:
> > 
> > net/dsa/qca8k.example.dtb: switch@10: ports:port@6: Unevaluated properties are not allowed ('qca,sgmii-rxclk-falling-edge' was unexpected)
> > 
> > Could you please explain why is the 'qca,sgmii-rxclk-falling-edge'
> > property not evaluated from the perspective of dsa.yaml in the example?
> > It's a head scratcher to me.
> 
> A schema with unevaluatedProperties can "see" into a $ref, but the 
> ref'ed schema having unevaluatedProperties can't see back to the 
> referring schema for properties defined there.
> 
> So if a schema is referenced by other schemas which can define their own 
> additional properties, that schema cannot have 'unevaluatedProperties: 
> false'. If both schemas have 'unevaluatedProperties: false', then it's 
> just redundant. We may end up doing that just because it's not obvious 
> when we have both or not, and no unevaluatedProperties/ 
> additionalProperties at all is a bigger issue. I'm working on a 
> meta-schema to check this.

Thanks for this information. So if I'm understanding correctly:

 - All DSA chips I'm modifying should reference dsa.yaml, as they
   currently are.
 - As such, these all should have unevaluatedProperties: true, so they
   can see into dsa.yaml.
 - dsa.yaml, and any schema that gets $ref:'d, can not have
   unevaluatedProperties: false, unless the desire is to forbid any
   other properties to be added.

I'll get another patch set out this week with all these changes, and
tested against the latest dt_bindings_check.

> 
> 
> > May it have something to do with the fact that Colin's addition:
> > 
> > $ref: "dsa.yaml#"
> > 
> > is not expressed as:
> > 
> > allOf:
> >   - $ref: "dsa.yaml#"
> > 
> > ?
> 
> No. Either way behaves the same. We generally only use 'allOf' when 
> there might be more than 1 entry. That is mostly just at the top-level.
> 
> Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ