All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arnd Bergmann" <arnd@kernel.org>
Cc: linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev,
	neil.armstrong@linaro.org, vkoul@kernel.org,
	linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	olteanv@gmail.com
Subject: Re: [PATCH 12/13] gpib: gpio: replace linux/gpio.h inclusion
Date: Tue, 30 Jun 2026 13:28:35 +0000	[thread overview]
Message-ID: <20260630132836.5FF0A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629132633.1300009-13-arnd@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] The patch introduces redundant duplicate `#include <linux/gpio/consumer.h>` statements in multiple files.

Pre-existing issues:
- [High] Missing bounds check on `priv->count` in `bb_DAV_interrupt()` can lead to a buffer overflow.
--

commit 198cff3fadd8f7ab5db98a0ff2a666f4ac7f1bf0
Author: Arnd Bergmann <arnd@arndb.de>

gpib: gpio: replace linux/gpio.h inclusion

linux/gpio.h is going away, so use linux/gpio/consumer.h instead.

> diff --git a/drivers/gpib/gpio/gpib_bitbang.c b/drivers/gpib/gpio/gpib_bitbang.c
> index 0e227980b493a..2e8d895db06a5 100644
> --- a/drivers/gpib/gpio/gpib_bitbang.c
> +++ b/drivers/gpib/gpio/gpib_bitbang.c
> @@ -64,7 +64,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/gpio/driver.h>
>  #include <linux/gpio/machine.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>

[Severity: Low]
This isn't a bug, but does this introduce a duplicate include of
linux/gpio/consumer.h? It appears to already be included a few lines above.

Similar duplicate includes might have been added to other files like
drivers/input/keyboard/matrix_keypad.c and drivers/net/phy/mdio_device.c
if they were also part of this series.

>  #include <linux/irq.h>
>  
>  static int sn7516x_used = 1, sn7516x;

While reviewing this file, I noticed a separate issue in bb_DAV_interrupt().

[Severity: High]
This is a pre-existing issue, but does this lack of a bounds check on
priv->count lead to a buffer overflow?

drivers/gpib/gpio/gpib_bitbang.c:bb_DAV_interrupt() {
        ...
        priv->rbuf[priv->count++] = get_data_lines();
        priv->end = !gpiod_get_value(EOI);
        ...
}

If the hardware line DAV goes low multiple times while priv->r_busy is set
without waiting for the normal NRFD/NDAC handshake, could priv->count exceed
the allocated buffer size and corrupt memory?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260629132633.1300009-1-arnd@kernel.org?part=12

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Arnd Bergmann" <arnd@kernel.org>
Cc: linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev,
	neil.armstrong@linaro.org, vkoul@kernel.org,
	linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	olteanv@gmail.com
Subject: Re: [PATCH 12/13] gpib: gpio: replace linux/gpio.h inclusion
Date: Tue, 30 Jun 2026 13:28:35 +0000	[thread overview]
Message-ID: <20260630132836.5FF0A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629132633.1300009-13-arnd@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] The patch introduces redundant duplicate `#include <linux/gpio/consumer.h>` statements in multiple files.

Pre-existing issues:
- [High] Missing bounds check on `priv->count` in `bb_DAV_interrupt()` can lead to a buffer overflow.
--

commit 198cff3fadd8f7ab5db98a0ff2a666f4ac7f1bf0
Author: Arnd Bergmann <arnd@arndb.de>

gpib: gpio: replace linux/gpio.h inclusion

linux/gpio.h is going away, so use linux/gpio/consumer.h instead.

> diff --git a/drivers/gpib/gpio/gpib_bitbang.c b/drivers/gpib/gpio/gpib_bitbang.c
> index 0e227980b493a..2e8d895db06a5 100644
> --- a/drivers/gpib/gpio/gpib_bitbang.c
> +++ b/drivers/gpib/gpio/gpib_bitbang.c
> @@ -64,7 +64,7 @@
>  #include <linux/gpio/consumer.h>
>  #include <linux/gpio/driver.h>
>  #include <linux/gpio/machine.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>

[Severity: Low]
This isn't a bug, but does this introduce a duplicate include of
linux/gpio/consumer.h? It appears to already be included a few lines above.

Similar duplicate includes might have been added to other files like
drivers/input/keyboard/matrix_keypad.c and drivers/net/phy/mdio_device.c
if they were also part of this series.

>  #include <linux/irq.h>
>  
>  static int sn7516x_used = 1, sn7516x;

While reviewing this file, I noticed a separate issue in bb_DAV_interrupt().

[Severity: High]
This is a pre-existing issue, but does this lack of a bounds check on
priv->count lead to a buffer overflow?

drivers/gpib/gpio/gpib_bitbang.c:bb_DAV_interrupt() {
        ...
        priv->rbuf[priv->count++] = get_data_lines();
        priv->end = !gpiod_get_value(EOI);
        ...
}

If the hardware line DAV goes low multiple times while priv->r_busy is set
without waiting for the normal NRFD/NDAC handshake, could priv->count exceed
the allocated buffer size and corrupt memory?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260629132633.1300009-1-arnd@kernel.org?part=12

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-06-30 13:28 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 13:26 [PATCH 00/13] treewide: replace linux/gpio.h Arnd Bergmann
2026-06-29 13:26 ` Arnd Bergmann
2026-06-29 13:26 ` Arnd Bergmann
2026-06-29 13:26 ` [PATCH 01/13] ARM: replace linux/gpio.h inclusions Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26 ` [PATCH 02/13] m68k/coldfire: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-07-06 11:22   ` Greg Ungerer
2026-07-06 11:22     ` Greg Ungerer
2026-07-06 11:22     ` Greg Ungerer
2026-06-29 13:26 ` [PATCH 03/13] mips: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 22:08   ` Philippe Mathieu-Daudé
2026-06-30 22:08     ` Philippe Mathieu-Daudé
2026-06-30 22:08     ` Philippe Mathieu-Daudé
2026-06-29 13:26 ` [PATCH 04/13] sh: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 22:08   ` Philippe Mathieu-Daudé
2026-06-30 22:08     ` Philippe Mathieu-Daudé
2026-06-30 22:08     ` Philippe Mathieu-Daudé
2026-06-29 13:26 ` [PATCH 05/13] mfd: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-07-06  8:59   ` Charles Keepax
2026-07-06  8:59     ` Charles Keepax
2026-07-06  8:59     ` Charles Keepax
2026-06-29 13:26 ` [PATCH 06/13] [net-next] net: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-06-29 13:26 ` [PATCH 07/13] ASoC: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-07-06  9:01   ` Charles Keepax
2026-07-06  9:01     ` Charles Keepax
2026-07-06  9:01     ` Charles Keepax
2026-06-29 13:26 ` [PATCH 08/13] pcmcia: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-06-30 13:36     ` Arnd Bergmann
2026-06-30 13:36       ` Arnd Bergmann
2026-06-29 13:26 ` [PATCH 09/13] phy: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-06-30 13:37     ` Arnd Bergmann
2026-06-30 13:37       ` Arnd Bergmann
2026-06-29 13:26 ` [PATCH 10/13] media: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26 ` [PATCH 11/13] Input: matrix_keyboard - replace linux/gpio.h inclusion Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-06-29 13:26 ` [PATCH 12/13] gpib: gpio: " Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot [this message]
2026-06-30 13:28     ` sashiko-bot
2026-06-29 13:26 ` [PATCH 13/13] gpiolib: remove linux/gpio.h Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-29 13:26   ` Arnd Bergmann
2026-06-30 13:28   ` sashiko-bot
2026-06-30 13:28     ` sashiko-bot
2026-06-30 13:31     ` Arnd Bergmann
2026-06-30 13:31       ` Arnd Bergmann
2026-06-30 22:09   ` Philippe Mathieu-Daudé
2026-06-30 22:09     ` Philippe Mathieu-Daudé
2026-06-30 22:09     ` Philippe Mathieu-Daudé
2026-06-29 14:01 ` [PATCH 00/13] treewide: replace linux/gpio.h Andreas Schwab
2026-06-29 14:01   ` Andreas Schwab
2026-06-29 14:01   ` Andreas Schwab
2026-06-29 14:24   ` Arnd Bergmann
2026-06-29 14:24     ` Arnd Bergmann
2026-06-29 14:24     ` Arnd Bergmann
2026-06-30  7:53 ` Bartosz Golaszewski
2026-06-30  7:53   ` Bartosz Golaszewski
2026-06-30  7:53   ` Bartosz Golaszewski
2026-06-30 21:39 ` Linus Walleij
2026-06-30 21:39   ` Linus Walleij
2026-06-30 21:39   ` Linus Walleij
2026-07-01  0:00 ` patchwork-bot+netdevbpf
2026-07-01  0:00   ` patchwork-bot+netdevbpf
2026-07-01  0:00   ` patchwork-bot+netdevbpf

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=20260630132836.5FF0A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arnd@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@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.