From: Simon Horman <horms@kernel.org>
To: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
Saeed Mahameed <saeed@kernel.org>, Gal Pressman <gal@nvidia.com>,
Dragos Tatulea <dtatulea@nvidia.com>,
David Laight <David.Laight@aculab.com>
Subject: Re: [PATCH net v1 1/2] net/mlx5e: Correct snprintf truncation handling for fw_version buffer
Date: Fri, 24 Nov 2023 11:39:51 +0000 [thread overview]
Message-ID: <20231124113951.GN50352@kernel.org> (raw)
In-Reply-To: <20231121230022.89102-1-rrameshbabu@nvidia.com>
On Tue, Nov 21, 2023 at 03:00:21PM -0800, Rahul Rameshbabu wrote:
> snprintf returns the length of the formatted string, excluding the trailing
> null, without accounting for truncation. This means that is the return
> value is greater than or equal to the size parameter, the fw_version string
> was truncated.
>
> Reported-by: David Laight <David.Laight@ACULAB.COM>
> Closes: https://lore.kernel.org/netdev/81cae734ee1b4cde9b380a9a31006c1a@AcuMS.aculab.com/
> Link: https://docs.kernel.org/core-api/kernel-api.html#c.snprintf
> Fixes: 41e63c2baa11 ("net/mlx5e: Check return value of snprintf writing to fw_version buffer")
> Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
prev parent reply other threads:[~2023-11-24 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 23:00 [PATCH net v1 1/2] net/mlx5e: Correct snprintf truncation handling for fw_version buffer Rahul Rameshbabu
2023-11-21 23:00 ` [PATCH net v1 2/2] net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors Rahul Rameshbabu
2023-11-24 11:40 ` Simon Horman
2023-11-24 11:39 ` 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=20231124113951.GN50352@kernel.org \
--to=horms@kernel.org \
--cc=David.Laight@aculab.com \
--cc=davem@davemloft.net \
--cc=dtatulea@nvidia.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rrameshbabu@nvidia.com \
--cc=saeed@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).