kernel_samsung_a53x/drivers/net/ethernet/mellanox
Rahul Rameshbabu 9531f65d69 net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors
[ Upstream commit b13559b76157de9d74f04d3ca0e49d69de3b5675 ]

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.

Link: https://docs.kernel.org/core-api/kernel-api.html#c.snprintf
Fixes: 1b2bd0c0264f ("net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors")
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:11:58 +01:00
..
mlx4 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mlx5/core net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors 2024-11-18 12:11:58 +01:00
mlxfw Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mlxsw mlxsw: Use size_mul() in call to struct_size() 2024-11-18 11:42:47 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00