Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3620113ybc; Thu, 14 Nov 2019 11:58:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxWnkeDqCT79fzUuhWnzPYw3HXiJidPCE3ykqPruKU9eV3Bj9C808xL9X/iDvh31ZQmhsno X-Received: by 2002:a7b:cf05:: with SMTP id l5mr10543049wmg.44.1573761507495; Thu, 14 Nov 2019 11:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573761507; cv=none; d=google.com; s=arc-20160816; b=KsgGl+ZmWnjNLrhidCNlm9eEZDJjLz3twWJvanmmhOKvq90sWfK8K92vwnHikV2cF7 4U9ZN2tFgNGWtwXeju/AJKy0hoTh87ndGv2F8CwTqaFID+gXc/nwrdPLbOk2ERPZyOzd Rh4S3gT6PRvP6/PCoZMp6X6FtLcvxbiX0xmD5JsOUgvzAv0c49eNVDEos6Fo+9Dg0xXX FQuw2bi4hlobp4ZywS90t2a2xrMjbid/rCYutf/zNqZgnpHIZh805+ZVj0PSark/maoL zax+8laou5sDjfE8BNF+CqRIqn0NK67kxi3cc8Y2qztM5nNZbVvBhFlKVe0qfe0bz6DH azog== 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=rMcK0vfklBoc6jwJF8I3LX4UqIxKfyFKfTWU5PL1/kQ=; b=Auf0nL8lZBkb4VXCacjrusnJ0UpjdIXlEZchyAfBjGbXrjKSILm6o4pgQ79i6s0oNU cEFg59lAzN0h7CtKg6G4CQN2YHSIro4FNfKbkyjvAvMUfw493sGpF7448PURkZ1ukBR2 TIpQqNJ/1QXDa0OITJ5DcOPVLi8XmtseHfI5dlKa3bK6vISyrBXRPFZ0S9DTvrgXvXoj nTnlJgiTzgmZmvZ/LengPosczwN5om+TyliUS5eNr0fMwBHK155Vy2v3HMY5eBGaHb5h cUSz/za/h8QxGqFkBlQM106gJGwABOjYSCOUkk3Z4/o0fpNlFPAnEwBrX6eyFAKr+Oc6 G35g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZMNvrFUC; 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 b7si4878848ede.12.2019.11.14.11.57.51; Thu, 14 Nov 2019 11:58:27 -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=ZMNvrFUC; 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 S1726533AbfKNT5o (ORCPT + 99 others); Thu, 14 Nov 2019 14:57:44 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:41332 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbfKNT5o (ORCPT ); Thu, 14 Nov 2019 14:57:44 -0500 Received: by mail-qt1-f193.google.com with SMTP id o3so8155171qtj.8 for ; Thu, 14 Nov 2019 11:57:44 -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=rMcK0vfklBoc6jwJF8I3LX4UqIxKfyFKfTWU5PL1/kQ=; b=ZMNvrFUCCj2a/rX8ay5atF5ewlQZuBbwovERCmYFMDubfn9AIH1Xw+g7WbJx8L0DkY RjE/eTernivgOmmX4fikkwocwn1ntxtf2A/UwIfeAoiuXjlGgPcWqMf5aDQvS79Ov4qM E0C6ZI4cN0tdh3IMHvxmWQ7Po/3dC+gmEfZz9r43HK75Ucpqxr9HN1sus9yqeb/HxAYS iQdJkQiMeARWDlqUye91Jark3YaBKF/gvSkuBLtVKG4esR4jc95jFH69RVgVMddB8ugJ 8LGXFiMBF5Rk2wFtw2GgstcDlx58jkciexU5nHUy73GsyRGLRtToKKwvzf0/VOnAwUZt MAsw== 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=rMcK0vfklBoc6jwJF8I3LX4UqIxKfyFKfTWU5PL1/kQ=; b=sQ+Cj3t6b7vAmIZVIeUFnUtZeRC+cw7xQS38M5KdFQ89ios0ffcnOJWeTaFFbS29+P CL2i/vBhWeQm/zophYLkN23EaFcWrkXh57GyMD9OoKqmjMzyhD56ZbzxEvNmhWRxCkJ4 eiFRQcHs6NKUBgn4e/hD4FOyVOJ5gSpsMSBpwkoK3+cnGwMPLdX40TK79c8qnBaCwbZR TpeaYtA+EQ5C0od7hOLC404Burv+CvKQTR06zaW4zo364uN7t9KGpT5Lp5K5/RAsaP0h HsGlAIrHTX9loag23gQffwPReKhuPLC/TT8NL+WpgY7B/DJNQH+VL9Nk37iwrZPBaWb4 4Bmg== X-Gm-Message-State: APjAAAVGyvZqBK9ZybaFrxPyqZEW6yY+2xWvHLI+ycShmfROlGH7bO2q PPMo+SNLeqR7eS8u2U0L/B5JM9E8opo= X-Received: by 2002:ac8:342b:: with SMTP id u40mr9915509qtb.87.1573761463527; Thu, 14 Nov 2019 11:57:43 -0800 (PST) Received: from ubuntu.wgti.net ([64.94.121.131]) by smtp.gmail.com with ESMTPSA id r36sm3924852qta.27.2019.11.14.11.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 11:57:42 -0800 (PST) From: Ming Chen X-Google-Original-From: Ming Chen To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Ming Chen Subject: [PATCH v2] mac80211: Drop the packets whose source or destination mac address is empty Date: Thu, 14 Nov 2019 11:57:12 -0800 Message-Id: <20191114195712.101568-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. --- According to review feedback, use the is_zero_ether_addr to check if the mac address is empty. Signed-off-by: Ming Chen --- 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