From: Simon Horman <horms@kernel.org>
To: Ian Bridges <icb@fastmail.org>
Cc: Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH net-next] devlink: Replace strlcat() with seq_buf
Date: Thu, 9 Jul 2026 17:34:56 +0100 [thread overview]
Message-ID: <20260709163456.GT1364329@horms.kernel.org> (raw)
In-Reply-To: <akiCtALVjd9TF8Xl@dev>
On Fri, Jul 03, 2026 at 10:49:08PM -0500, Ian Bridges wrote:
> In preparation for removing the strlcat() API[1], replace its uses in
> __devlink_compat_running_version().
>
> The function accumulates a variable number of version strings into a
> fixed buffer, which is what seq_buf is for. The seq_buf is anchored at
> the end of any existing string in the buffer and each version string
> is appended with a single seq_buf_printf(). The output is unchanged,
> including under truncation.
>
> Link: https://github.com/KSPP/linux/issues/370 [1]
> Signed-off-by: Ian Bridges <icb@fastmail.org>
> ---
> The patch was tested as follows, on top of net-next:
> - x86_64 allmodconfig and allyesconfig builds of net/devlink/dev.o at
> W=1 produce no warnings.
> - A userspace comparison of the old and new construction ran with
> randomized version lists and buffer contents across all buffer
> fill levels. The outputs are byte-identical in every case,
> including on overflow.
> - The changed path was exercised in a QEMU guest through the ethtool
> GDRVINFO ioctl against a netdevsim device, before and after the
> change, with identical fw_version output.
Reviewed-by: Simon Horman <horms@kernel.org>
prev parent reply other threads:[~2026-07-09 16:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-04 3:49 [PATCH net-next] devlink: Replace strlcat() with seq_buf Ian Bridges
2026-07-09 16:34 ` Simon Horman [this message]
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=20260709163456.GT1364329@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=icb@fastmail.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox