linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: sparx5: Fix get_stat64 crash in tcpdump
@ 2022-02-03 10:29 Steen Hegelund
  2022-02-04  3:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Steen Hegelund @ 2022-02-03 10:29 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, UNGLinuxDriver, netdev,
	linux-arm-kernel, linux-kernel
  Cc: Steen Hegelund

This problem was found with Sparx5 when the tcpdump tool requests the
do_get_stats64 (sparx5_get_stats64) statistic.

The portstats pointer was incorrectly incremented when fetching priority
based statistics.

Fixes: af4b11022e2d (net: sparx5: add ethtool configuration and statistics support)
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c b/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
index 59783fc46a7b..10b866e9f726 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
@@ -1103,7 +1103,7 @@ void sparx5_get_stats64(struct net_device *ndev,
 	stats->tx_carrier_errors = portstats[spx5_stats_tx_csense_cnt];
 	stats->tx_window_errors = portstats[spx5_stats_tx_late_coll_cnt];
 	stats->rx_dropped = portstats[spx5_stats_ana_ac_port_stat_lsb_cnt];
-	for (idx = 0; idx < 2 * SPX5_PRIOS; ++idx, ++stats)
+	for (idx = 0; idx < 2 * SPX5_PRIOS; ++idx)
 		stats->rx_dropped += portstats[spx5_stats_green_p0_rx_port_drop
 					       + idx];
 	stats->tx_dropped = portstats[spx5_stats_tx_local_drop];
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: sparx5: Fix get_stat64 crash in tcpdump
  2022-02-03 10:29 [PATCH net] net: sparx5: Fix get_stat64 crash in tcpdump Steen Hegelund
@ 2022-02-04  3:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-04  3:20 UTC (permalink / raw)
  To: Steen Hegelund
  Cc: davem, kuba, UNGLinuxDriver, netdev, linux-arm-kernel, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 3 Feb 2022 11:29:00 +0100 you wrote:
> This problem was found with Sparx5 when the tcpdump tool requests the
> do_get_stats64 (sparx5_get_stats64) statistic.
> 
> The portstats pointer was incorrectly incremented when fetching priority
> based statistics.
> 
> Fixes: af4b11022e2d (net: sparx5: add ethtool configuration and statistics support)
> Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
> 
> [...]

Here is the summary with links:
  - [net] net: sparx5: Fix get_stat64 crash in tcpdump
    https://git.kernel.org/netdev/net/c/ed14fc7a79ab

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-04  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 10:29 [PATCH net] net: sparx5: Fix get_stat64 crash in tcpdump Steen Hegelund
2022-02-04  3:20 ` patchwork-bot+netdevbpf

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).