From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: sparkhuang <huangshaobo3@xiaomi.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
linux-kernel@vger.kernel.org, weipengliang@xiaomi.com,
wengjinfei@xiaomi.com, caodan1@xiaomi.com
Subject: Re: [PATCH v2] regulator: core: Protect regulator_supply_alias_list with regulator_list_mutex
Date: Thu, 27 Nov 2025 16:55:50 +0000 [thread overview]
Message-ID: <aSiClqDJJMPMqBNJ@opensource.cirrus.com> (raw)
In-Reply-To: <20251127025716.5440-1-huangshaobo3@xiaomi.com>
On Thu, Nov 27, 2025 at 10:57:16AM +0800, sparkhuang wrote:
> regulator_supply_alias_list was accessed without any locking in
> regulator_supply_alias(), regulator_register_supply_alias(), and
> regulator_unregister_supply_alias(). Concurrent registration,
> unregistration and lookups can race, leading to:
>
> 1 use-after-free if an alias entry is removed while being read,
> 2 duplicate entries when two threads register the same alias,
> 3 inconsistent alias mappings observed by consumers.
>
> Protect all traversals, insertions and deletions on
> regulator_supply_alias_list with the existing regulator_list_mutex.
>
> Fixes: a06ccd9c3785f ("regulator: core: Add ability to create a lookup alias for supply")
> Signed-off-by: sparkhuang <huangshaobo3@xiaomi.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
next prev parent reply other threads:[~2025-11-27 16:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 6:15 [PATCH] regulator: core: Protect regulator_supply_alias_list with regulator_list_mutex sparkhuang
2025-11-26 12:58 ` Mark Brown
2025-11-26 14:44 ` Charles Keepax
2025-11-26 14:51 ` Mark Brown
2025-11-27 2:57 ` [PATCH v2] " sparkhuang
2025-11-27 16:55 ` Charles Keepax [this message]
2025-11-27 21:52 ` Mark Brown
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=aSiClqDJJMPMqBNJ@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=caodan1@xiaomi.com \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=huangshaobo3@xiaomi.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=weipengliang@xiaomi.com \
--cc=wengjinfei@xiaomi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.