The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=51dfae383bf6298af9e6d816a78b92b6f34d68be
commit 51dfae383bf6298af9e6d816a78b92b6f34d68be Author: Adrian Chadd <[email protected]> AuthorDate: 2021-03-13 01:29:09 +0000 Commit: Adrian Chadd <[email protected]> CommitDate: 2021-03-13 01:33:07 +0000 [ath] validate ts_antenna before updating tx statistics Right now ts_antenna is either 0 or 1 in each supported HAL so this is purely a sanity check. Later on if I ever get magical free time I may add some extensions for the NICs that can have slightly more complicated antenna switches for transmit and I'd like this to not bust memory. --- sys/dev/ath/if_ath.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 34a9311c834a..0ef10e529dd5 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -4175,6 +4175,11 @@ ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, if (ts->ts_status == 0) { u_int8_t txant = ts->ts_antenna; + /* + * Handle weird/corrupted tx antenna field + */ + if (txant >= ATH_IOCTL_STATS_NUM_TX_ANTENNA) + txant = 0; sc->sc_stats.ast_ant_tx[txant]++; sc->sc_ant_tx[txant]++; if (ts->ts_finaltsi != 0) _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main To unsubscribe, send any mail to "[email protected]"
