All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, andrew@lunn.ch, gregory.clement@bootlin.com,
	sebastian.hesselbarth@gmail.com, lee@kernel.org,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/3] auxdisplay: Add 7-segment LED display driver
Date: Thu, 7 Mar 2024 15:23:29 +0200	[thread overview]
Message-ID: <Zem_0dph7FMwE42u@smile.fi.intel.com> (raw)
In-Reply-To: <CAMuHMdUzrkRk_07SfQoZoe8b+bxkX+fLH_f5tVqbUZu23=DN_Q@mail.gmail.com>

On Thu, Mar 07, 2024 at 02:13:23PM +0100, Geert Uytterhoeven wrote:
> On Thu, Mar 7, 2024 at 12:50 AM Chris Packham
> <chris.packham@alliedtelesis.co.nz> wrote:

...

> > +       DECLARE_BITMAP(values, 8) = { 0 };

While doing next version, drop this '0', as we have in another terminator
the same approach (i.o.w. for the sake of consistency).

...

> > +       gpiod_set_array_value_cansleep(priv->segment_gpios->ndescs, priv->segment_gpios->desc,
> > +                                      priv->segment_gpios->info, values);
> 
> This may still cause an out-of-bounds access of values if ndescs > 8.

Not really. It will be only for ndescs >= 32 (on 32-bit) or 64
(on 64-bit accordingly).

But good catch, we better to narrow the range down.

-- 
With Best Regards,
Andy Shevchenko



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, andrew@lunn.ch, gregory.clement@bootlin.com,
	sebastian.hesselbarth@gmail.com, lee@kernel.org,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/3] auxdisplay: Add 7-segment LED display driver
Date: Thu, 7 Mar 2024 15:23:29 +0200	[thread overview]
Message-ID: <Zem_0dph7FMwE42u@smile.fi.intel.com> (raw)
In-Reply-To: <CAMuHMdUzrkRk_07SfQoZoe8b+bxkX+fLH_f5tVqbUZu23=DN_Q@mail.gmail.com>

On Thu, Mar 07, 2024 at 02:13:23PM +0100, Geert Uytterhoeven wrote:
> On Thu, Mar 7, 2024 at 12:50 AM Chris Packham
> <chris.packham@alliedtelesis.co.nz> wrote:

...

> > +       DECLARE_BITMAP(values, 8) = { 0 };

While doing next version, drop this '0', as we have in another terminator
the same approach (i.o.w. for the sake of consistency).

...

> > +       gpiod_set_array_value_cansleep(priv->segment_gpios->ndescs, priv->segment_gpios->desc,
> > +                                      priv->segment_gpios->info, values);
> 
> This may still cause an out-of-bounds access of values if ndescs > 8.

Not really. It will be only for ndescs >= 32 (on 32-bit) or 64
(on 64-bit accordingly).

But good catch, we better to narrow the range down.

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-03-07 13:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 23:50 [PATCH v5 0/3] auxdisplay: 7-segment LED display Chris Packham
2024-03-06 23:50 ` Chris Packham
2024-03-06 23:50 ` [PATCH v5 1/3] auxdisplay: Add 7-segment LED display driver Chris Packham
2024-03-06 23:50   ` Chris Packham
2024-03-07 13:13   ` Geert Uytterhoeven
2024-03-07 13:13     ` Geert Uytterhoeven
2024-03-07 13:23     ` Andy Shevchenko [this message]
2024-03-07 13:23       ` Andy Shevchenko
2024-03-06 23:50 ` [PATCH v5 2/3] dt-bindings: auxdisplay: Add bindings for generic 7-segment LED Chris Packham
2024-03-06 23:50   ` Chris Packham
2024-03-07 13:11   ` Geert Uytterhoeven
2024-03-07 13:11     ` Geert Uytterhoeven
2024-03-07 14:52   ` Rob Herring
2024-03-07 14:52     ` Rob Herring
2024-03-06 23:50 ` [PATCH v5 3/3] ARM: dts: marvell: Add 7-segment LED display on x530 Chris Packham
2024-03-06 23:50   ` Chris Packham
2024-03-08  7:36   ` Gregory CLEMENT
2024-03-08  7:36     ` Gregory CLEMENT
2024-03-08  9:56     ` Andy Shevchenko
2024-03-08  9:56       ` Andy Shevchenko
2024-03-08 10:18       ` Arnd Bergmann
2024-03-08 10:18         ` Arnd Bergmann
2024-03-08 10:34         ` Andy Shevchenko
2024-03-08 10:34           ` Andy Shevchenko
2024-03-10 20:22           ` Chris Packham
2024-03-10 20:22             ` Chris Packham
2024-03-11  6:02             ` Arnd Bergmann
2024-03-11  6:02               ` Arnd Bergmann
2024-03-11 19:54               ` Chris Packham
2024-03-11 19:54                 ` Chris Packham
2024-03-07 12:07 ` [PATCH v5 0/3] auxdisplay: 7-segment LED display Andy Shevchenko
2024-03-07 12:07   ` Andy Shevchenko

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=Zem_0dph7FMwE42u@smile.fi.intel.com \
    --to=andy@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gregory.clement@bootlin.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.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 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.