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:   Tue, 28 Apr 2020 13:18:26 +0200
From:   Ahmad Fatoum <a.fatoum@...gutronix.de>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     kernel@...gutronix.de, ceggers@...i.de,
        Ahmad Fatoum <a.fatoum@...gutronix.de>,
        Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v3 1/2] dt-bindings: nvmem: skip nodes with compatibles other than "nvmem-cell"

For nodes matching the nvmem binding, all child objects matching
"^.*@[0-9a-f]+$" are assumed to be nvmem cells, without taking a
compatible into account.

This precludes:

  - future extension of e.g. eeprom nodes by any child nodes other
    than nvmem cells
  - extending the NVMEM binding to nodes that already have other
    child nodes, e.g., MTD and its partitions

To allow co-existence of nvmem-cells with other nodes, loosen the
binding to consult an optional compatible property for the cells:

  - if a compatible exists, it must be "nvmem-cell"
  - if none exists, it's assumed to be a nvmem cell, like before

As additionalProperties: false was specified for nvmem-cell bindings,
a compatible property was so far invalid. This means no already
compliant device tree should be reinterpreted differently after
this binding adjustment and in that regard, the change is completely
backwards-compatible.

This resolves an existing clash between this nvmem-cell binding and
the barebox bootloader binding that extends the fixed-partitions MTD
binding to EEPROMs.

Signed-off-by: Ahmad Fatoum <a.fatoum@...gutronix.de>
---
 Documentation/devicetree/bindings/nvmem/nvmem.yaml | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
index 65980224d550..c39f5dd7e1aa 100644
--- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
+++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
@@ -44,9 +44,21 @@ properties:
 
 patternProperties:
   "^.*@[0-9a-f]+$":
-    type: object
+    if:
+      properties:
+        compatible:
+          items:
+            const: nvmem-cell
+    then:
+      $ref: "#/definitions/nvmem-cell"
 
+definitions:
+  nvmem-cell:
     properties:
+      compatible:
+          items:
+            const: nvmem-cell
+
       reg:
         maxItems: 1
         description:
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ