Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2510954ybc; Wed, 13 Nov 2019 15:56:29 -0800 (PST) X-Google-Smtp-Source: APXvYqz7oPeOgI7HgKBPvI1/VNpzncsjP+UQz1HykPznylpNrxN2yby6Jsec/bQIOnTExYJ82fIe X-Received: by 2002:aa7:d842:: with SMTP id f2mr6633103eds.262.1573689389689; Wed, 13 Nov 2019 15:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573689389; cv=none; d=google.com; s=arc-20160816; b=HbkvGeHWv2ayhqlZHT2ommgI2w8xd2+tz+hMLzmwY/VxJLvsMFhHzV53eq+CwAcAcP Ua8es3kQp/qhoeVPo/9oJ0kUv5Z4uK4KafQnrJJaEaV+owMDyC6iTgwEJ5VQAlUUyjKo zns5nRLGyuXbtM1krGgz4qinpvDE+wW5HigKVNpRPeKJ4JI+CY7EuqGwT4iZeOVh2PFs HqCSrnqjcu8qDLEwXt6HTagTLSaYstwa9Uelc0yD9yqua53UHT9mnvH0jMqkmBMwOcRd 5ANoTTL2fq+1KavBt8tNO6tweAV13HiJzaCVfZ5k4nXN70h0vuOittQer1J+RKfLy9mG dU1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=JB/xftZHmG+eByqeZoQConbCpTOrGr5ABu1yhgA+4gI=; b=VcYTPvSVpAWkapar+3C+3S0iK9YTmto1o5wiWbCJhOwn/YVp9krSE6wpf1cm2jLsmf keHxf30krIWeci0fe/4PS3PSBgmMnlgM3gcQQdrVTtk/LCUn/17VPHW1pm44QLIqI506 HUpdmKxQe5te3rbvgI0Y2vNnbfciK0ASAibg3bn9LDfeTwKJE/CAxeVurqUdABOxy9FQ 7qK1CusABFtIXPCofe8pyMhn/slAEfcGWo4i1Kl+6xA4khRCf+exKM2LAH4jxnIsg1dE y0ifH3LT9ypf9ibvaCtObGl02OP7W3rLBCStdqZI5RvklDu2R2oL3Pf1OZdPxj2WP+l5 h2rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YkvuAb7l; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be23si2505030edb.103.2019.11.13.15.55.56; Wed, 13 Nov 2019 15:56:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YkvuAb7l; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbfKMXzN (ORCPT + 99 others); Wed, 13 Nov 2019 18:55:13 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44196 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbfKMXzM (ORCPT ); Wed, 13 Nov 2019 18:55:12 -0500 Received: by mail-qk1-f194.google.com with SMTP id m16so3434640qki.11 for ; Wed, 13 Nov 2019 15:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JB/xftZHmG+eByqeZoQConbCpTOrGr5ABu1yhgA+4gI=; b=YkvuAb7lWDVGDaH1ajYJMNluNqkGsKexHsApLF+Asddi/Xe7cOF3bMMnURTjcynCrI /ba6HcY63Be50/SUhc/Y/O8xm+0jD98TQdT0o+4xMVHBRFBSlbAvBBv2aMda9h2dq5mH I1yplAeN/Gd1s5CunGoxpdZG2mTwHPS6JpdEnFCvNmjH+3HG7iuwy7yN3gmBaKlQQajT BSKM44M696pFXTykJJrCaRB+xQs9DOsEOuy2gBTcht532FhWFZS25Dbv7Ew6fzpFtToJ gukIr4yGGS8ZTllgWhU83Wx5mFcjOG7ks+eaUFDEovkf+tvenecDSSNnqECFWYNkgxSy W90w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JB/xftZHmG+eByqeZoQConbCpTOrGr5ABu1yhgA+4gI=; b=baYEsJTdHwCeGcdyevwgCmo/RZWwyYls/6L4DFu/QVKauRtZQVHe9stEqiYqXjXWt1 UZqzbjL0fzEzwNMswLyULAfUvV4E3fH97WWg4lr/HJXZoEz70wYQf3zK1t0SAhl4Hr+Q pBYUvuzzMMxvBaF8W0KpGUmXJn3K6grYNjgEJ2EVUb0WnMLKFJt6oiddBvQLr/16De/j 6TdBjdhC1AECfwvwU+c5exDVTzodsSOsrhLR2r69HZ+kwy6/+7sfyawBWnzd4utJetAZ j1QX/F7e/unD36ic0znJkkD6BVFgb/JHXhbWwCfMNowNHY4g2ZQONT4GLNhmC/jZeVKX oBjw== X-Gm-Message-State: APjAAAXcRY/tOMe9SpK1IPw8XyP5bZUB6euTeC7mnyIX1okPmwkVYRW5 FSZuz1FE0OOxxSnfs6bxZLmh29iqrik= X-Received: by 2002:a05:620a:3dd:: with SMTP id r29mr5198065qkm.370.1573689311704; Wed, 13 Nov 2019 15:55:11 -0800 (PST) Received: from ubuntu.wgti.net ([64.94.121.131]) by smtp.gmail.com with ESMTPSA id 134sm1335501qkn.24.2019.11.13.15.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 15:55:10 -0800 (PST) From: Ming Chen X-Google-Original-From: Ming Chen To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Ming Chen Subject: [PATCH] mac80211: Drop the packets whose source or destination mac address is empty Date: Wed, 13 Nov 2019 15:55:05 -0800 Message-Id: <20191113235505.70905-1-ming.chen@watchguard.com> X-Mailer: git-send-email 2.17.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org We occasionally found ath9k could receive some packets from Linux IP stack with empty source and destination mac address,which will result in the driver cannot find the station node in TX complete. And thus, the driver will complete this buffer but without updating the block ack window. To fix this issue, we should drop this kind of error packet before it goes into the driver. --- net/mac80211/tx.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index db38be1b75fa..0668123e8e85 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2481,6 +2481,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, bool tdls_peer; bool multicast; u16 info_id = 0; + const int empty_mac[ETH_ALEN] = {0}; struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_sub_if_data *ap_sdata; enum nl80211_band band; @@ -2489,6 +2490,13 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, if (IS_ERR(sta)) sta = NULL; + /* drop this skb when source mac or destination mac is empty */ + if (!memcmp(skb->data, empty_mac, ETH_ALEN) || + !memcmp(skb->data + ETH_ALEN, empty_mac, ETH_ALEN)) { + ret = -ENOTCONN; + goto free; + } + #ifdef CONFIG_MAC80211_DEBUGFS if (local->force_tx_status) info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; @@ -3414,6 +3422,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, struct ieee80211_local *local = sdata->local; u16 ethertype = (skb->data[12] << 8) | skb->data[13]; int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); + const int empty_mac[ETH_ALEN] = {0}; int hw_headroom = sdata->local->hw.extra_tx_headroom; struct ethhdr eth; struct ieee80211_tx_info *info; @@ -3435,6 +3444,12 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS) return false; + /* drop this skb when source mac or destination mac is empty */ + if (!memcmp(skb->data, empty_mac, ETH_ALEN) || + !memcmp(skb->data + ETH_ALEN, empty_mac, ETH_ALEN)) { + return false; + } + if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); -- 2.17.1