Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3290284rwb; Fri, 9 Dec 2022 12:27:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf598sGk9iE7wYGOyWaRzLogczCWqs9LCAHcNNd1o5Q/UASY1RtaU+O4RfBLUcKoxLPnwKUm X-Received: by 2002:a17:90b:1913:b0:219:396c:9e30 with SMTP id mp19-20020a17090b191300b00219396c9e30mr7110493pjb.20.1670617639738; Fri, 09 Dec 2022 12:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670617639; cv=none; d=google.com; s=arc-20160816; b=QQHyPySu9e2sBuUFhKWKkIRSP6NGsc2e0DvOFUGPyx2ak8qRKRLsJH4qoRJnb2YPdv onYsETuqD7wPWBvmh9U0c3acTNEEGbrv8isu3WIl6PSgCja/VesndPr1+cfWJ9k2M8lw JKUwJylVdCD/mEWny83yB80ebxTW3GwgOUFeIvBBjibJpauJhuG1j+VqepYI4cpPah/R 6ZHypcYTDId3hPcPIAH9sKeKSIUftrqEXPVEaObsYwszQcB/iU0v+Na66JKU0DIOl+yi Ff/d0GdUA6cQF16rCSwdOeMvi62bKzDU5nHHx0sKHDhhtkJ3rjPWQpL0Ukub/0FB3xSo jmxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kBTvEwwPYkhDgOHZgqMsIladGgyNsgcuwtJJruzv6is=; b=lNUBSri07meqQG8e1DEjFoBSMXvzPpVc73uto2rlcWwBHwiniROdb/nRe6Gh8LIKHC d9B/5BVUw0Qr9LfHv/t8GH/vm9cese2Gf4hM91Hkwo3G/nzOtAfDvGapRi1bswxoyEO6 3cUrDfb9XBAAMgDD0gLyhevaNdztRiyv635LpL13O5Q/xkrl2CEO2c/HM70JE7ep7V6H AOtJyKROaWs7+osEFXEZAHiUGURNdLdDnyVlS3bmOgXEEPPb04kjiiqMd/3niBJeOx09 tBMd9jguTUUr4AaJCjZbB8OnhvMfKoqu6PiNVstbRegvlVurUr5o+hazFih4Jt25NXcS 4/mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=j6TZCyAD; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf11-20020a17090b1d8b00b00205da45d8a5si3127203pjb.124.2022.12.09.12.27.09; Fri, 09 Dec 2022 12:27:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=j6TZCyAD; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbiLIUVc (ORCPT + 66 others); Fri, 9 Dec 2022 15:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbiLIUVZ (ORCPT ); Fri, 9 Dec 2022 15:21:25 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0299B8D195 for ; Fri, 9 Dec 2022 12:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kBTvEwwPYkhDgOHZgqMsIladGgyNsgcuwtJJruzv6is=; b=j6TZCyADyXzKu2jOeCgIkdOZVa NKRjNfXb1arzQOkVoJT8J0kMeCUzrB9uBEO1eZxKv1qGO54LJWDf0qma1UKO/l+5JGgpbzcAfGqL/ ACjSEdwQQfwROy5CXPbq/MWNRxKL22NbP8O7WR22hhU3i40lnLE9ihRymAD7MtZ4iT/8=; Received: from p200300daa71613018d4aa8a5d898f578.dip0.t-ipconnect.de ([2003:da:a716:1301:8d4a:a8a5:d898:f578] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1p3js1-007Tjz-Mb; Fri, 09 Dec 2022 21:21:21 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [RFC 1/5] wifi: cfg80211: move A-MSDU check in ieee80211_data_to_8023_exthdr Date: Fri, 9 Dec 2022 21:21:17 +0100 Message-Id: <20221209202121.55951-1-nbd@nbd.name> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When parsing the outer A-MSDU header, don't check for inner bridge tunnel or RFC1042 headers. This is handled by ieee80211_amsdu_to_8023s already. Signed-off-by: Felix Fietkau --- net/wireless/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index 8f403f9fe816..6848e26707e8 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -631,8 +631,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr, break; } - if (likely(skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 && - ((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) && + if (likely(!is_amsdu && + skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 && + ((ether_addr_equal(payload.hdr, rfc1042_header) && payload.proto != htons(ETH_P_AARP) && payload.proto != htons(ETH_P_IPX)) || ether_addr_equal(payload.hdr, bridge_tunnel_header)))) { -- 2.38.1