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: <CAJKOXPcGWuW7HP-_kj_OjpPyHtj9gr36bpVUeT5VF2V9wTZY9Q@mail.gmail.com>
Date:   Tue, 3 Sep 2019 15:29:19 +0200
From:   Krzysztof Kozlowski <krzk@...nel.org>
To:     Rob Herring <robh+dt@...nel.org>
Cc:     Sebastian Reichel <sre@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        "open list:THERMAL" <linux-pm@...r.kernel.org>,
        devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: power: syscon-reboot: Convert bindings
 to json-schema

On Tue, 3 Sep 2019 at 15:12, Rob Herring <robh+dt@...nel.org> wrote:
> > arch/arm/boot/dts/exynos3250-artik5-eval.dt.yaml: syscon-reboot:
> > {'regmap': [[9]], 'mask': [[1]], '$nodename': ['syscon-reboot'],
> > 'value': [[1]], 'offset': [[1024]], 'compatible': ['syscon-reboot']}
> > is valid under each of {'required': ['mask']}, {'required': ['value',
> > 'mask']}, {'required': ['value']}
>
> Ahh, right. 'anyOf' is what we want:
>
> anyOf:
>   - required: [ value ]
>   - required: [ mask ]

This triggers meta-schema error:

  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
Traceback (most recent call last):
  File "/home/kozik/.local/lib/python3.5/site-packages/dtschema/lib.py",
line 429, in process_schema
    DTValidator.check_schema(schema)
  File "/home/kozik/.local/lib/python3.5/site-packages/dtschema/lib.py",
line 575, in check_schema
    raise jsonschema.SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: Additional properties are not
allowed ('anyOf' was unexpected)

Failed validating 'additionalProperties' in metaschema['allOf'][0]:
    {'$id': 'http://devicetree.org/meta-schemas/base.yaml#',
     '$schema': 'http://json-schema.org/draft-07/schema#',
     'additionalProperties': False,
     'allOf': [{'$ref': 'http://json-schema.org/draft-07/schema#'}],
     'description': 'Metaschema for devicetree binding documentation',
     'properties': {'$id': {'pattern':
'http://devicetree.org/schemas/.*\\.yaml#'},
                    '$schema': {'enum':
['http://devicetree.org/meta-schemas/core.yaml#',

'http://devicetree.org/meta-schemas/base.yaml#']},
                    'additionalProperties': {'type': 'boolean'},
                    'allOf': {'items': {'propertyNames': {'enum': ['$ref',
                                                                   'if',
                                                                   'then',
                                                                   'else']}}},
                    'definitions': True,
                    'dependencies': True,
                    'description': True,
                    'else': True,
                    'examples': {'items': {'type': 'string'},
                                 'type': 'array'},
                    'if': True,
                    'maintainers': {'items': {'format': 'email',
                                              'type': 'string'},
                                    'type': 'array'},
                    'oneOf': True,
                    'patternProperties': True,
                    'properties': True,
                    'required': True,
                    'select': {'allOf': [{'$ref':
'http://json-schema.org/draft-07/schema#'},
                                         {'oneOf': [{'properties':
{'properties': True,

'required': True},
                                                     'type': 'object'},
                                                    {'type': 'boolean'}]}]},
                    'then': True,
                    'title': {'maxLength': 100},
                    'unevaluatedProperties': {'type': 'boolean'}},
     'required': ['$id', '$schema', 'title', 'maintainers']}

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ