Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath10k: fix RX of frames with broken FCS in monitor mode

So far, frames were forwarded regardless of the FCS correctness leading
to userspace applications listening on the monitor mode interface to
receive potentially broken frames, even with the "fcsfail" flag unset.

By default, with the "fcsfail" flag of a monitor mode interface
unset, frames with FCS errors should be dropped. With this patch, the
fcsfail flag is taken into account correctly.

Tested-on: QCA4019 firmware-5-ct-full-community-12.bin-lede.011

Cc: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Linus Lüssing and committed by
Kalle Valo
ea0c3e2a 7005eafc

+10
+1
drivers/net/wireless/ath/ath10k/core.h
··· 1181 1181 1182 1182 struct { 1183 1183 /* protected by data_lock */ 1184 + u32 rx_crc_err_drop; 1184 1185 u32 fw_crash_counter; 1185 1186 u32 fw_warm_reset_counter; 1186 1187 u32 fw_cold_reset_counter;
+2
drivers/net/wireless/ath/ath10k/debug.c
··· 1094 1094 "d_rts_good", 1095 1095 "d_tx_power", /* in .5 dbM I think */ 1096 1096 "d_rx_crc_err", /* fcs_bad */ 1097 + "d_rx_crc_err_drop", /* frame with FCS error, dropped late in kernel */ 1097 1098 "d_no_beacon", 1098 1099 "d_tx_mpdus_queued", 1099 1100 "d_tx_msdu_queued", ··· 1194 1193 data[i++] = pdev_stats->rts_good; 1195 1194 data[i++] = pdev_stats->chan_tx_power; 1196 1195 data[i++] = pdev_stats->fcs_bad; 1196 + data[i++] = ar->stats.rx_crc_err_drop; 1197 1197 data[i++] = pdev_stats->no_beacons; 1198 1198 data[i++] = pdev_stats->mpdu_enqued; 1199 1199 data[i++] = pdev_stats->msdu_enqued;
+7
drivers/net/wireless/ath/ath10k/htt_rx.c
··· 1285 1285 1286 1286 status = IEEE80211_SKB_RXCB(skb); 1287 1287 1288 + if (!(ar->filter_flags & FIF_FCSFAIL) && 1289 + status->flag & RX_FLAG_FAILED_FCS_CRC) { 1290 + ar->stats.rx_crc_err_drop++; 1291 + dev_kfree_skb_any(skb); 1292 + return; 1293 + } 1294 + 1288 1295 ath10k_dbg(ar, ATH10K_DBG_DATA, 1289 1296 "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", 1290 1297 skb,