Skip to content

Commit ed14fc7

Browse files
steen-hegelund-mchpkuba-moo
authored andcommitted
net: sparx5: Fix get_stat64 crash in tcpdump
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: af4b110 (net: sparx5: add ethtool configuration and statistics support) Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Link: https://lore.kernel.org/r/20220203102900.528987-1-steen.hegelund@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent dcb85f8 commit ed14fc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ void sparx5_get_stats64(struct net_device *ndev,
11031103
stats->tx_carrier_errors = portstats[spx5_stats_tx_csense_cnt];
11041104
stats->tx_window_errors = portstats[spx5_stats_tx_late_coll_cnt];
11051105
stats->rx_dropped = portstats[spx5_stats_ana_ac_port_stat_lsb_cnt];
1106-
for (idx = 0; idx < 2 * SPX5_PRIOS; ++idx, ++stats)
1106+
for (idx = 0; idx < 2 * SPX5_PRIOS; ++idx)
11071107
stats->rx_dropped += portstats[spx5_stats_green_p0_rx_port_drop
11081108
+ idx];
11091109
stats->tx_dropped = portstats[spx5_stats_tx_local_drop];

0 commit comments

Comments
 (0)