[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <172439887133.2069692.5497848773911564354.b4-ty@kernel.org>
Date: Fri, 23 Aug 2024 08:41:11 +0100
From: Lee Jones <lee@...nel.org>
To: Lee Jones <lee@...nel.org>, Kees Cook <kees@...nel.org>
Cc: Pavel Machek <pavel@....cz>, linux-leds@...r.kernel.org,
"Gustavo A. R. Silva" <gustavoars@...nel.org>, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: (subset) [PATCH] leds: gpio: Set num_leds after allocation
On Tue, 16 Jul 2024 14:24:59 -0700, Kees Cook wrote:
> With the new __counted_by annotation, the "num_leds" variable needs to
> valid for accesses to the "leds" array. This requirement is not met in
> gpio_leds_create(), since "num_leds" starts at "0", so "leds" index "0"
> will not be considered valid (num_leds would need to be "1" to access
> index "0").
>
> Fix this by setting the allocation size after allocation, and then update
> the final count based on how many were actually added to the array.
>
> [...]
Applied, thanks!
[1/1] leds: gpio: Set num_leds after allocation
commit: 045391a02bd971d431c83ad03f7cc51b6e2fe331
--
Lee Jones [李琼斯]
Powered by blists - more mailing lists