Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Lee Jones <lee@kernel.org>, Nishanth Menon <nm@ti.com>,
	Tero Kristo <kristo@kernel.org>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	"Thomas Richard (TI)" <thomas.richard@bootlin.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH 09/10] clk: keystone: sci-clk: Check allocation failure before copying clock array
Date: Thu, 3 Dec 2026 16:57:33 -0600	[thread overview]
Message-ID: <bd4af234-b747-4b10-8cb8-616408d88024@ti.com> (raw)
In-Reply-To: <179632227333.3916230.7698020620975219390.b4-reply@b4>

On 12/3/26 12:24 PM, Jerome Brunet wrote:
> On 2026-12-03 10:21 -0600, Andrew Davis wrote:
>> On 11/27/26 1:25 PM, Lee Jones wrote:
>>> ti_sci_scan_clocks_from_fw() calls devm_kmalloc_objs() without checking
>>> for NULL before passing tmp_clks into memcpy(), and invokes memcpy()
>>> with a NULL source pointer on the initial iteration when max_clks is
>>> zero.
>>>
>>> Return -ENOMEM if devm_kmalloc_objs() fails, and only copy and free the
>>> previous array when max_clks is non-zero.
>>>
>>> Fixes: 3c13933c6033 ("clk: keystone: sci-clk: add support for dynamically probing clocks")
>>> Closes: https://sashiko.dev/#/bug/linux-4e2ecf16-17f1-4188-880c-c714a1bf588c
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Lee Jones <lee@kernel.org>
>>> ---
>>
>> LGTM,
>>
>> Acked-by: Andrew Davis <afd@ti.com>
>>
>> Side note though, this function `ti_sci_scan_clocks_from_fw()` is an unused
>> legacy function that was kept around for possible debugging. Now that AI
>> is finding bugs in it and causing churn, might be time to just delete the
>> whole function..
> 
> Please submit this change. This is something we can't figure out without your
> help. Thanks
> 

Sure thing, done: https://lore.kernel.org/all/20261203224910.861331-1-afd@ti.com/

Andrew


  reply	other threads:[~2026-12-03 22:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 19:25 [PATCH 00/10] clk: Fix OOB writes, UAFs, ERR_PTR dereferences, and rate-calc bugs (batch 2) Lee Jones
2026-11-27 19:25 ` [PATCH 05/10] clk: rockchip: cpu: Allocate rate_table before registering notifier Lee Jones
2026-11-29 16:42   ` Heiko Stuebner
2026-11-30 14:51     ` Lee Jones
2026-12-02 19:03       ` Jerome Brunet
2026-12-02 19:52         ` Lee Jones
2026-12-04 10:14         ` Heiko Stübner
2026-12-04 10:15           ` Heiko Stübner
2026-11-27 19:25 ` [PATCH 09/10] clk: keystone: sci-clk: Check allocation failure before copying clock array Lee Jones
2026-12-03 16:21   ` Andrew Davis
2026-12-03 18:24     ` Jerome Brunet
2026-12-03 22:57       ` Andrew Davis [this message]
2026-11-27 19:25 ` [PATCH 10/10] clk: versatile: icst: Check kasprintf() and put parent node on error Lee Jones
2026-12-04  9:24 ` (subset) [PATCH 00/10] clk: Fix OOB writes, UAFs, ERR_PTR dereferences, and rate-calc bugs (batch 2) Jerome Brunet

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=bd4af234-b747-4b10-8cb8-616408d88024@ti.com \
    --to=afd@ti.com \
    --cc=bmasney+clk@redhat.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=kristo@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thomas.richard@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox