mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Abdurrahman Hussain" <abdurrahman@nexthop.ai>
To: <sashiko-reviews@lists.linux.dev>
Cc: <robh@kernel.org>, <saravanak@kernel.org>,
	<frowand.list@gmail.com>, <krzk@kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/9] of: hold a reference on of_aliases during alias path resolution
Date: Thu, 23 Jul 2026 10:07:34 -0700	[thread overview]
Message-ID: <DK646A1WF1ZD.3TKHBS1F9IQB2@nexthop.ai> (raw)
In-Reply-To: <20260723033554.022251F00A3A@smtp.kernel.org>

On Tue Jul 22, 2026 at 8:35 PM PDT, sashiko-bot wrote:
> [Severity: High]
> This isn't a bug introduced by this patch, but is the description of the
> lock-free walk accurate?
>
> If a concurrent writer (e.g., overlay application) removes a property while
> for_each_property_of_node() is iterating over it, won't the reader's next
> access of pp->next follow the pointer into the deadprops list?

Right, the commit message misstates the mechanism.
__of_remove_property() repoints prop->next at the deadprops head, so
a racing walker can be diverted into deadprops and miss live
properties. What it cannot do is step into freed memory while it
holds the node reference: dead properties are only freed at node
release. So the conclusion stands (the walk is memory-safe without
the lock) but the failure mode is a stale view, the same as every
other lock-free property walk in the tree. I'll fix the wording in
the next revision.

> [Severity: High]
> This is a pre-existing issue, but does calling __of_find_node_by_full_path()
> while holding devtree_lock further down in this function risk a
> sleep-in-atomic bug?

Known, and tracked in the cover letter's open items. It affects every
OF iterator that puts nodes under devtree_lock and needs a series of
its own.

Thanks,
Abdurrahman

  parent reply	other threads:[~2026-07-23 17:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  3:19 [PATCH v5 0/9] of: teach overlay code to keep /aliases in sync Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 1/9] of: hold a reference on of_aliases during alias path resolution Abdurrahman Hussain
     [not found]   ` <20260723033554.022251F00A3A@smtp.kernel.org>
2026-07-23 17:07     ` Abdurrahman Hussain [this message]
2026-07-23  3:19 ` [PATCH v5 2/9] of: update /aliases lookup on reconfig notifications Abdurrahman Hussain
2026-08-05  8:34   ` Geert Uytterhoeven
2026-08-05 18:35     ` Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 3/9] of/overlay: look up absolute target-paths absolutely Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 4/9] of/overlay: put property on deadprops only after changeset add succeeds Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 5/9] of/overlay: don't keep a negative id in ovcs->id on idr_alloc() failure Abdurrahman Hussain
2026-08-05  8:26   ` Geert Uytterhoeven
2026-08-05 18:47     ` Abdurrahman Hussain
2026-08-06  7:50       ` Geert Uytterhoeven
2026-07-23  3:19 ` [PATCH v5 6/9] of/overlay: don't create "//" paths for fragments targeting the root Abdurrahman Hussain
     [not found]   ` <20260723033553.1261D1F000E9@smtp.kernel.org>
2026-07-23 17:07     ` Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 7/9] of/overlay: return ERR_PTR from dup_and_fixup_symbol_prop() Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 8/9] of/overlay: rewrite /aliases path values to live-tree paths Abdurrahman Hussain
2026-07-23  3:19 ` [PATCH v5 9/9] 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=DK646A1WF1ZD.3TKHBS1F9IQB2@nexthop.ai \
    --to=abdurrahman@nexthop.ai \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    --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

all inboxes | Powered by JetHome®