All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Ronan Marchal <ronanmarchal29@gmail.com>
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Subject: Re: [PATCH v2] net: niu: fix potential buffer overflow/truncation in irq names
Date: Wed, 5 Aug 2026 18:10:00 +0100	[thread overview]
Message-ID: <20260805171000.GY51943@horms.kernel.org> (raw)
In-Reply-To: <20260803211149.10585-1-ronanmarchal29@gmail.com>

On Mon, Aug 03, 2026 at 11:11:49PM +0200, Ronan Marchal wrote:
> Building with W=1 reports a -Wformat-truncation warning on
> niu_set_irq_name(): the "%s:SYSERR" format could be truncated
> because irq_name[] was one byte too small for the worst case
> interface name length (IFNAMSIZ-1) plus the ":SYSERR" suffix.
> 
> Increase the irq_name buffer size to account for the suffix and
> replace the remaining sprintf() calls in the same function with
> snprintf() to avoid possible buffer overflows.
> 
> Tested:
> - Built the kernel with W=1 and confirmed the warning is no longer reported.
> - No NIU hardware was available for runtime testing.
> 
> Signed-off-by: Ronan Marchal <ronanmarchal29@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>

FTR, I will list my feedback to the AI-generated review of this patch
available at
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260803211149.10585-1-ronanmarchal29%40gmail.com


1. -Wformat-overflow is the correct diagnostic rather than -Wformat-truncation

   Yes, I agree. But I don't think a respin is warranted only to address this.

2. Suggestion to add a fixes tag

   No, this is addresses a theoretical concern rather than a bug
   that manifests. It should not have a fixes tag.

3. Claim that not all sprintf() calls in the function have been updated as
   the commit message seems to claim.

   This appears to be true. But I don't think it warrants a respin.

  reply	other threads:[~2026-08-05 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 21:11 [PATCH v2] net: niu: fix potential buffer overflow/truncation in irq names Ronan Marchal
2026-08-05 17:10 ` Simon Horman [this message]
2026-08-07 23:50 ` 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=20260805171000.GY51943@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ronanmarchal29@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.