All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Tobias Johansson <Tobias.Johansson@axis.com>
Cc: "pavel@kernel.org" <pavel@kernel.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kernel <Kernel@axis.com>
Subject: Re: [PATCH] leds: lp50xx: Read default intensity from devicetree
Date: Wed, 2 Dec 2026 12:09:25 +0000	[thread overview]
Message-ID: <20261202120925.GA43081@kernel.org> (raw)
In-Reply-To: <4d98d460cc5db453139e6dc2953988ca6282a06f.camel@axis.com>

On Mon, 23 Nov 2026, Tobias Johansson wrote:

> On Thu, 2026-11-19 at 09:52 +0000, Lee Jones wrote:
> > On Mon, 09 Nov 2026, Tobias Johansson wrote:
> > 
> > Please review, explain or fix the Sashiko review(s).
> > 
> 
> The issue Sashiko flagged is a real pre-existing bug: num_colors is
> incremented for every child node, so a devicetree with more than three
> sub-LED nodes reusing valid reg indices makes num_colors exceed the
> subled_info allocation. I can fix this by rejecting LED nodes with more
> than LP50XX_LEDS_PER_MODULE children.
> 
> > > +			fwnode_property_read_u32(led_node,
> > > "default-intensity",
> > > +						
> > > &mc_led_info[multi_index].intensity);
> > 
> > (multi_index >= LP50XX_LEDS_PER_MODULE) only tests for values too
> > large.
> > 
> > What happens if `multi_index` is < 0?  OOB?
> > 
> 
> Yes, good catch. multi_index is read with fwnode_property_read_u32()
> into a signed int, so values with the high bit set become negative and
> bypass the upper-bound check, causing an OOB write. I can change
> multi_index to u32 so the existing check covers it.
> 
> Since both issues are pre-existing and caused by malformed devicetrees,
> I can send up a new patch series to fix these two issues hopefully
> sometime this week.

It would be ideal if you could include this patch as part of the set.

-- 
Lee Jones

      reply	other threads:[~2026-12-02 12:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 12:58 [PATCH] leds: lp50xx: Read default intensity from devicetree Tobias Johansson
2026-11-09 13:09 ` sashiko-bot
2026-11-19  9:52 ` Lee Jones
2026-11-23 12:36   ` Tobias Johansson
2026-12-02 12:09     ` Lee Jones [this message]

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=20261202120925.GA43081@kernel.org \
    --to=lee@kernel.org \
    --cc=Kernel@axis.com \
    --cc=Tobias.Johansson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@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 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.