From: Fayssal Benmlih <Fayssal.Benmlih@arm.com>
To: Cristian Marussi <Cristian.Marussi@arm.com>
Cc: "arm-scmi@vger.kernel.org" <arm-scmi@vger.kernel.org>,
"d-gole@ti.com" <d-gole@ti.com>,
"david@kernel.org" <david@kernel.org>,
Elif Topuz <Elif.Topuz@arm.com>,
"etienne.carriere@st.com" <etienne.carriere@st.com>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
"james.quinlan@broadcom.com" <james.quinlan@broadcom.com>,
"jic23@kernel.org" <jic23@kernel.org>,
"kas@kernel.org" <kas@kernel.org>,
"kernel-team@meta.com" <kernel-team@meta.com>,
"leitao@kernel.org" <leitao@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Lukasz Luba <Lukasz.Luba@arm.com>,
"michal.simek@amd.com" <michal.simek@amd.com>,
"peng.fan@oss.nxp.com" <peng.fan@oss.nxp.com>,
Philip Radford <Philip.Radford@arm.com>,
"puranjay@kernel.org" <puranjay@kernel.org>,
Souvik Chakravarty <Souvik.Chakravarty@arm.com>,
"sudeep.holla@kernel.org" <sudeep.holla@kernel.org>,
"usama.arif@linux.dev" <usama.arif@linux.dev>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>
Subject: Re: [PATCH v10 07/24] firmware: arm_scmi: Add support to parse SHMTIs areas
Date: Fri, 21 Aug 2026 15:19:42 +0000 [thread overview]
Message-ID: <55CF80E4-F6AF-4164-86C4-35968FC132FF@contoso.com> (raw)
In-Reply-To: <<20260815232604.3730754-8-cristian.marussi@arm.com>>
Hi Cristian,
The UUID pointer copy and nonzero initial capacity are fixed in V10.
Two related lifetime and overflow issues appear to remain.
In scmi_telemetry_uuids_update(), both:
ti->uuids_len * 2
and the following:
ti->uuids_len *= 2;
can wrap before the allocation or stored capacity is updated. The initial
ti->num_shmti * 2 calculation has the same issue. Please use checked
multiplication and reject an unrepresentable capacity.
There is also still a race between scmi_telemetry_line_get() and
scmi_telemetry_line_put().
line_get() loads the XArray entry under lines_mtx, releases the mutex, and
only then increments the refcount. line_put() decrements the refcount before
taking lines_mtx to erase the entry. A concurrent put can therefore reach
zero after the lookup but before the increment, and then erase and free the
object.
Please increment the reference while protected by the same lifetime lock,
or use refcount_inc_not_zero() with an appropriate XArray/RCU scheme. The
zero transition, erase, and free must also be coordinated with lookup.
Thanks,
Fayçal
next parent reply other threads:[~2026-08-21 15:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<20260815232604.3730754-8-cristian.marussi@arm.com>
2026-08-21 15:19 ` Fayssal Benmlih [this message]
2026-08-15 23:25 [PATCH v10 00/24] Introduce SCMI Telemetry support Cristian Marussi
2026-08-15 23:25 ` [PATCH v10 07/24] firmware: arm_scmi: Add support to parse SHMTIs areas Cristian Marussi
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=55CF80E4-F6AF-4164-86C4-35968FC132FF@contoso.com \
--to=fayssal.benmlih@arm.com \
--cc=Cristian.Marussi@arm.com \
--cc=Elif.Topuz@arm.com \
--cc=Lukasz.Luba@arm.com \
--cc=Philip.Radford@arm.com \
--cc=Souvik.Chakravarty@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=d-gole@ti.com \
--cc=david@kernel.org \
--cc=etienne.carriere@st.com \
--cc=f.fainelli@gmail.com \
--cc=james.quinlan@broadcom.com \
--cc=jic23@kernel.org \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=leitao@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=peng.fan@oss.nxp.com \
--cc=puranjay@kernel.org \
--cc=sudeep.holla@kernel.org \
--cc=usama.arif@linux.dev \
--cc=vincent.guittot@linaro.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