Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4193206ybc; Fri, 15 Nov 2019 00:03:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwo4VbjMtv5TZENX1RIdIlbgmuTYUV9DPzm5JP2JSJm9c8lVNtSynYFMJLhFhz9XMqMlJZX X-Received: by 2002:a17:906:a388:: with SMTP id k8mr11556166ejz.223.1573805014820; Fri, 15 Nov 2019 00:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573805014; cv=none; d=google.com; s=arc-20160816; b=P+DfMjPB0CccUPpTNhDqJQjaIUknYIg+/mRP+znlN5kIz8ZbFYxV4npvI+8kqsWdC8 qO3J+rJIIMEgeOlIkM6YH9iVOUybwMWh5QHJskIjkXW1AdaxT3vzFGjiDkkDeRcp6nRM pkx3FuCypW4VRE1mYlzbpYL9IRs/GJuYx1NhF9lr6F1OSGQ5n15Dw3b51BZw6jsm2PDO EFNqo/SFATe+3m2TYgzO/YZsQe3g2hhGiq27fhu1OZ2G7tu0ZoVwLVn2+x/Qr2eIqFBQ bDtnBV7RDtKymURWtZJnFMcXaJ+lnswVh9JSIGn2fExpuRZBj0JIE/ZUfx3fyfiq5gnM W+cQ== 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=rUk2UFLWwTbCedOCxT8lGDtJxih2bllQMzQrq34KHmQ=; b=fFRT1Rgnkdg9OhFW7KIYHYfCmWhaT3XI0h/rRQQiwbhqjgpLXfXOAq07KWSM+FVcZ2 XmNB2tFVb1rnDed8mIIZsmVkGqz10nSDnxBiRQaDreF8+e/HdgrAtxZJSoZuyyGPkFTO XBPHxrGvGwAzuq6JKSNdPJHESyeABaa8U0mzMgUYFraPHZiBWzOGPkoG9pox8BqDo7GS F0snZcUImLqDsyrrZ5fEjxWZAQR9YVHffwCOqICaS8PbWjgbdb8/l3DJTiImGt028o18 P8k2EjX0Le1CM650VXOpW/pYF8qi9xf3MOqs3mTpKheo9ZHh78SiW+ssV9R5eSXh0A9v TI1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iCXSHc+H; 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 d30si5945591edj.289.2019.11.15.00.03.07; Fri, 15 Nov 2019 00:03:34 -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=iCXSHc+H; 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 S1726605AbfKOIAD (ORCPT + 99 others); Fri, 15 Nov 2019 03:00:03 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38654 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfKOIAD (ORCPT ); Fri, 15 Nov 2019 03:00:03 -0500 Received: by mail-qt1-f196.google.com with SMTP id p20so9938810qtq.5 for ; Fri, 15 Nov 2019 00:00:01 -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=rUk2UFLWwTbCedOCxT8lGDtJxih2bllQMzQrq34KHmQ=; b=iCXSHc+He7qMtyxsj8AZYIpId42eipyXOIR3HQp9mJPlsDhQjerLvHXNq+4y1D1s/K yN2IWsHo2eIo/svDUqvUFDjVZqbp4KNjxmf+Sc9ZT7FTU+bDJmf1Woh3HA7zUj4Wj4U3 k54eAvEZBZl4HVEw3Js0ASAXBIUkKxZeGIubh9zFiayUOiNnmdwJ8LYKC1hU+pHxgw22 gpH7riNz4qwAqTcT5GU9TaSVxS3m2Eehdi9SMek3zfAZBgbg9MT6HFAq8LXcYjmXrdu6 rDp58f0qUDuV8jK/cNc0WcUK/m1ttFpkp4dT/T/Z3RMGiBoX3jHeKHqAdxDEpRLXAJq+ TNJw== 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=rUk2UFLWwTbCedOCxT8lGDtJxih2bllQMzQrq34KHmQ=; b=aT+oCF7geLCxTg5tuc0ptc3JZ+/5UuU5DtDnC573Par3maOk3Ihx91LLhenenY079+ BSMeiNOUiLl8/jmwk28nOdqP449mmi9Dh3Ea1mLRI9QPSwz4vAotMedFcs/N/UZnjKsF yy1E3ls+rjtVWyfVmS5gc0UYPbGx+4amRB8OOoUQEDwjSw60YabYHLqS79L8WEI2vzeV g1Dvks3H4X2bFKPQGoUgiYMqUothjLwKhXRS6LgG6FjacDxUH40W+TQDTPuyk/9Y2ZpF 0W6OtDdL9r04Hl19NdHtahypW61u+/UvwInI0AySY4GUQwjg5/nN6Eb9vIqJ/w+ep8Ol v4Kg== X-Gm-Message-State: APjAAAUu2ZgArBnpC/iwfW81FGxxrMdaj2x8vv0LQxxeMtZBev271J0O yfUPr7dOsIeLohoYqnVisICdVIYA50M= X-Received: by 2002:ac8:7216:: with SMTP id a22mr12431767qtp.187.1573804800744; Fri, 15 Nov 2019 00:00:00 -0800 (PST) Received: from ubuntu.wgti.net ([64.94.121.131]) by smtp.gmail.com with ESMTPSA id n56sm4554656qtb.73.2019.11.14.23.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 23:59:59 -0800 (PST) From: Ming Chen X-Google-Original-From: Ming Chen To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Ming Chen Subject: [PATCH v3] mac80211: Drop the packets whose source or destination mac address is empty Date: Thu, 14 Nov 2019 23:59:42 -0800 Message-Id: <20191115075942.120943-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. Signed-off-by: Ming Chen --- v3: -Fix s-o-b location v2: -According to review feedback, use the is_zero_ether_addr to check if the mac address is empty. --- net/mac80211/tx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index db38be1b75fa..b18745a3f6b0 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2489,6 +2489,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 (is_zero_ether_addr(skb->data) || + is_zero_ether_addr(skb->data + ETH_ALEN)) { + ret = -ENOTCONN; + goto free; + } + #ifdef CONFIG_MAC80211_DEBUGFS if (local->force_tx_status) info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; @@ -3435,6 +3442,11 @@ 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 (is_zero_ether_addr(skb->data) || + is_zero_ether_addr(skb->data + 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