[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231124113951.GN50352@kernel.org>
Date: Fri, 24 Nov 2023 11:39:51 +0000
From: Simon Horman <horms@...nel.org>
To: Rahul Rameshbabu <rrameshbabu@...dia.com>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Saeed Mahameed <saeed@...nel.org>, Gal Pressman <gal@...dia.com>,
Dragos Tatulea <dtatulea@...dia.com>,
David Laight <David.Laight@...lab.com>
Subject: Re: [PATCH net v1 1/2] net/mlx5e: Correct snprintf truncation
handling for fw_version buffer
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@...LAB.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@...dia.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists