Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3] dt-bindings: pinctrl: convert nsp-gpio binding
Date: Sun, 27 Sep 2026 21:37:32 +0000	[thread overview]
Message-ID: <20260927213733.24AE41F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260927212748.123558-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dt-bindings: pinctrl: brcm,nsp-gpio validation bypass for primitive properties
--

commit a919d3facb51d5d2222a14b7538f8617f24e8169
Author: Rosen Penev <rosenp@gmail.com>

dt-bindings: pinctrl: convert nsp-gpio binding

Convert the brcm,nsp-gpio.txt legacy text binding to a YAML schema.
Keep existing required and optional properties, including generic pinconf
child nodes, and configure node matching.

> diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,nsp-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/brcm,nsp-gpio.yaml
> new file mode 100644
> index 0000000000000..e5144da1bf57e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/brcm,nsp-gpio.yaml
[ ... ]
> +  '-hog(-[0-9]+)?$':
> +    type: object
> +    required:
> +      - gpio-hog
> +
> +additionalProperties:
> +  anyOf:
> +    - $ref: '#/$defs/nsp-gpio-pinconf'
> +    - not:
> +        type: object

[Severity: High]
Does this anyOf block with "not: type: object" inadvertently allow any
misspelled or undocumented primitive property (such as typos like
gpui-controller) to bypass dt-binding validation?

If a device tree introduces an unknown top-level primitive property
(like a boolean, integer, or array), it will fall through to
additionalProperties. Since its value is a primitive rather than an
object, it will successfully match the "not: type: object" condition.

Can we instead enforce additionalProperties: false or
unevaluatedProperties: false at the top level and explicitly match valid
child nodes using patternProperties to prevent validation bypass?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260927212748.123558-1-rosenp@gmail.com?part=1

  reply	other threads:[~2026-09-27 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27 21:27 [PATCH v3] dt-bindings: pinctrl: convert nsp-gpio binding Rosen Penev
2026-09-27 21:37 ` sashiko-bot [this message]
2026-09-28 21:28 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260927213733.24AE41F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rosenp@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox