From: "Abdurrahman Hussain" <abdurrahman@nexthop.ai>
To: "Krzysztof Kozlowski" <krzk@kernel.org>
Cc: <robh@kernel.org>, <saravanak@kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/6] of: resolve alias-prefixed paths under devtree_lock
Date: Wed, 22 Jul 2026 12:09:29 -0700 [thread overview]
Message-ID: <DK5C52KFMI5B.18JB928Y6Y5UH@nexthop.ai> (raw)
In-Reply-To: <20260722-noisy-husky-of-security-6dd93c@quoll>
On Wed Jul 22, 2026 at 12:30 AM PDT, Krzysztof Kozlowski wrote:
> > While here, validate the value's shape before handing it to
> > of_find_node_by_path(): /aliases contents can now come from overlays
>
> Can it?
Not at this point in the series -- patches 2-5 are what make /aliases
writable at runtime. The message got ahead of the series; I'll reword
it to stand alone.
> All this looks like AI written.
The tooling is disclosed in the Assisted-by trailer. I'll cut the
prose down in the reroll.
> > + raw_spin_lock_irqsave(&devtree_lock, flags);
>
> Since when do we lock looping over for_each_property_of_node()?
>
> Do I understand correctly your proposal: you want to add
> raw_spin_lock_irqsave() over every piece of code having for_each_XXX
> OF-loop?
No. You're right that the walk doesn't need the lock: removed
properties move to the node's deadprops list and keep their ->next, so
a walker holding a node reference never steps into freed memory.
That's why every other for_each_XXX user is fine lock-free, and I
shouldn't have pulled the loop under the lock.
What does need pairing is the of_aliases pointer load. Patch 2 adds a
reconfig notifier that clears of_aliases and drops the reference it
holds when the node is detached -- overlays can create and destroy
/aliases from that point on. A reader that loads the bare pointer
without taking its own reference under the same lock can have the
node (and its deadprops) freed under it mid-walk.
I'll reroll with the lock narrowed to the pointer load plus
of_node_get(), and the property walk lock-free as everywhere else.
Thanks,
Abdurrahman
next prev parent reply other threads:[~2026-07-22 19:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 1:01 [PATCH v4 0/6] of: teach overlay code to keep /aliases in sync Abdurrahman Hussain
2026-07-22 1:01 ` [PATCH v4 1/6] of: resolve alias-prefixed paths under devtree_lock Abdurrahman Hussain
2026-07-22 7:30 ` Krzysztof Kozlowski
2026-07-22 19:09 ` Abdurrahman Hussain [this message]
2026-07-22 1:01 ` [PATCH v4 2/6] of: incrementally update /aliases lookup on reconfig notifications Abdurrahman Hussain
2026-07-22 7:35 ` Krzysztof Kozlowski
2026-07-22 1:01 ` [PATCH v4 3/6] of/overlay: look up absolute target-paths absolutely Abdurrahman Hussain
2026-07-22 1:01 ` [PATCH v4 4/6] of/overlay: return ERR_PTR from dup_and_fixup_symbol_prop() Abdurrahman Hussain
2026-07-22 7:36 ` Krzysztof Kozlowski
2026-07-22 19:09 ` Abdurrahman Hussain
2026-07-22 1:01 ` [PATCH v4 5/6] of/overlay: rewrite /aliases path values to live-tree paths Abdurrahman Hussain
2026-07-22 1:01 ` [PATCH v4 6/6] of: unittest: cover /aliases updates from overlay apply/revert Abdurrahman Hussain
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=DK5C52KFMI5B.18JB928Y6Y5UH@nexthop.ai \
--to=abdurrahman@nexthop.ai \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@kernel.org \
/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
all inboxes | Powered by JetHome®