From: Lee Jones <lee@kernel.org>
To: Kees Cook <kees@kernel.org>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Pavel Machek <pavel@ucw.cz>,
linux-leds@vger.kernel.org,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] leds: gpio: Set num_leds after allocation
Date: Fri, 23 Aug 2024 08:42:11 +0100 [thread overview]
Message-ID: <20240823074211.GM6858@google.com> (raw)
In-Reply-To: <202408221713.77EF78D1@keescook>
On Thu, 22 Aug 2024, Kees Cook wrote:
> On Thu, Jul 25, 2024 at 11:22:40AM +0100, Lee Jones wrote:
> > On Tue, 16 Jul 2024, Gustavo A. R. Silva wrote:
> >
> > >
> > >
> > > On 16/07/24 15:24, 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.
> > > >
> > > > Fixes: 52cd75108a42 ("leds: gpio: Annotate struct gpio_leds_priv with __counted_by")
> > > > Signed-off-by: Kees Cook <kees@kernel.org>
> > >
> > > Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> > >
> > > Thanks
> > > --
> >
> > Using the signature tag in the middle of an email turns the remainder of
> > the body into a signature block, which is odd to say the least. By all
> > means sign-off in the middle of a mail, but please refrain from
> > converting the rest of the mail.
>
> Ping. Shall I take this via the hardening tree?
Certainly not. :)
Apologies, looks like I relied to Gustavo then marked the submission as
reviewed. Applied to the LED tree now, thanks.
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2024-08-23 7:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 21:24 [PATCH] leds: gpio: Set num_leds after allocation Kees Cook
2024-07-16 21:50 ` Gustavo A. R. Silva
2024-07-25 10:22 ` Lee Jones
2024-08-23 0:14 ` Kees Cook
2024-08-23 7:42 ` Lee Jones [this message]
2024-08-23 7:41 ` (subset) " Lee Jones
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=20240823074211.GM6858@google.com \
--to=lee@kernel.org \
--cc=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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.