From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796213369; b=ia3QKgdfq0IZF8QjSXnj+RCaa5w7VsoD4HSrbnrKidFuAD67U5c+6f/xhMRocc0YIzPK SYMXbhMO+AkPu0gtaGVoVm5SmYhNonWr1VDyYbw/ClrsKxYp58BQE1sXJQOA9JCeSCAMM Pkr3Su9ok0sGCyi+lI5ykf9TvyIpp3h46YkULGCD/MZVxzroaa78CvrM1QrTI4zHByM06 nAarD5T/a5nsglfWgF0jKDKix4cA/vrYpFiqgM3h46FsNJG3XVJb3NWWP0gn8zkD3+TsA yqxxa+d3/Qt5MXrukfzkkr9efRnEhmt5HxnyjHJDclgU0mUcXCQmEaPFMQ/Wo9mD2HA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796213369; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=voOxUJWtOBXtixygBjUyc0MlQ3IRyP3lkesbmut6rn4=; b=TUeKkv5+71t+jB83Mpft+xhYCaBhrrP5e0US+atXe6Vx98Wjpw1/JbyMtne6zTCuLv/1 0TW/g8hDRiUYjUl9bARhsO0MhPd4uGW7Mo4tY+9acar49sOBKFnZ9uOL6nNCBPPqw+TJw EUgnl5yUjR87Af+sJE3U4RpNw77V3d5ADstW2dbvAPGQkd8lz8Lo8GgxjM8qUAIGXspdh 9l5DTzgdE/uK2TnzqyUndYG/+WS3GdrzsLEdHX+v0Q5PSExv2XY2e5Lvyy9mxSywPJCi5 TNPVRrqlzs4eERJnAmzj+yPzN1O1DFaBewl/bZcXCJodVp9qeBvw4pvps1z1zs1tcXA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cElkOHc6; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 701B6606A684; Wed, 2 Dec 2026 12:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cElkOHc6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF8601F0092C; Wed, 2 Dec 2026 12:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796213368; bh=voOxUJWtOBXtixygBjUyc0MlQ3IRyP3lkesbmut6rn4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=cElkOHc6RtoBJe/SoiLfLjCppuWD5GkpgS+jH7BgjqE6pskCUK3HgBceSoY7Kt/eO 1D6QpMwcamxrEJT4GuAT+S531W4xeIQIGSf75qbGd3NBLz+UADX8CIf3YdRulUdv5C jK2lKrW4/qj292mHrJjVK8SuCfl3Ry5ASERKA9Hqt5gRJoHOJ1q5BMMC0Z7KjEs0LE /VDzqpB+RAIoVWfv17U6qzoI33fo7sDS0Ld+XX24UwRAFzEIbgadif5RRH3Wv/IWwg WfIAZ0LKH66kFHi41gI33ma3PJ47WSYp1I7o6FNN/Do5rJ+s2E0SGJqeemyDqmPmIU fdgjo7xb8NWZQ== Date: Wed, 2 Dec 2026 12:09:25 +0000 From: Lee Jones To: Tobias Johansson Cc: "pavel@kernel.org" , "linux-leds@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kernel Subject: Re: [PATCH] leds: lp50xx: Read default intensity from devicetree Message-ID: <20261202120925.GA43081@kernel.org> References: <20261109-b4-leds-lp50xx-default-intensity-v1-1-0a04a3533df6@axis.com> <179442102947.44545.9103121805533352120@kernel.org> <4d98d460cc5db453139e6dc2953988ca6282a06f.camel@axis.com> X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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