Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3752198pxj; Tue, 11 May 2021 11:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh2Te20jtGwu4X+sFZJLsbjOPYqLXm6LiFWrgRXi9I9UVnTfe6FRGgR+Jtmqaik/3088AL X-Received: by 2002:a05:6512:36d9:: with SMTP id e25mr11778032lfs.405.1620756288615; Tue, 11 May 2021 11:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620756288; cv=none; d=google.com; s=arc-20160816; b=CEausAr5BbIN7hPjUnqnrbxLcBvGFElhJZLYO0iOGZeYwSYMfW1t/RpLXWmcWPZbuL qo0e76G3VZ4x/Ii9rawzYVblCsnQMyAgy7Uk8iy4uO2dUafbm20veWJ400+rOt6KKR0V h1HSsFAmeqzvPiQMuRZuOt5B8j1i/AVM2tntD4Z3Pl5NBjpZoW6EiTOWQBfpfRDe+K2I Jo9er6xqfWIWWPp4GHSC+3r3PeXD/RKL80fKojWTKQq6IOkFI2YfW4OhOxEVZWfXlNY+ mgSQcH3nYmbdRuEc2PBPMWrWfyelRSbvy5b+nbQVjafJP4H6aMHCqf7+3N4EnQaBE7z1 M4YQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OahgQIKzLNo2/TS1JEa07lI1jvVswaqPdgR/sFAExjQ=; b=zRx6a9XZWueE1VczHXeAouej8gR0na6dqtse3N/Rhm6zUdPvb9+Zr8W0Qre+vYdaSf QCwJIjurkXM/YuDveZRPaT8kXVsl9FrUaG60UPXcPi0p65n9QW+S5P9rUd0jVuIN9EeL lEagdZG1JuHM2J6qbLrGnkpbFqysPJ0Uzhm57PJDvB8bIeZ7CaiE3ps6FZndWvshhJ2g LW11VeOFVZ0hMSPDbGPgrXQdJsA8TN4KI8L3916SQGKLj9D+H7eMZPZkwqRiudSPOphT fVUoOBuD8v4ts2UWVG8eR0O6TID3mLjF+jXeEXZadTKoxMHeRH8gv4/Nz7hGPhB/wCRr lHzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si14193960lji.246.2021.05.11.11.04.18; Tue, 11 May 2021 11:04:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbhEKSEu (ORCPT + 99 others); Tue, 11 May 2021 14:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbhEKSEY (ORCPT ); Tue, 11 May 2021 14:04:24 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD45C061348; Tue, 11 May 2021 11:03:15 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1lgWiv-007aAS-FH; Tue, 11 May 2021 20:03:13 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Sriram R , stable@vger.kernel.org Subject: [PATCH 18/18] ath11k: Drop multicast fragments Date: Tue, 11 May 2021 20:02:59 +0200 Message-Id: <20210511200110.1d53bfd20a8b.Ibb63283051bb5e2c45951932c6e1f351d5a73dc3@changeid> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210511180259.159598-1-johannes@sipsolutions.net> References: <20210511180259.159598-1-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sriram R Fragmentation is used only with unicast frames. Drop multicast fragments to avoid any undesired behavior. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Cc: stable@vger.kernel.org Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: Johannes Berg --- drivers/net/wireless/ath/ath11k/dp_rx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 3382f8bfcb48..603d2f93ac18 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -260,6 +260,16 @@ static void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); } +static bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, + struct hal_rx_desc *desc) +{ + struct rx_attention *attn = ath11k_dp_rx_get_attention(ab, desc); + + return ath11k_dp_rx_h_msdu_end_first_msdu(ab, desc) && + (!!FIELD_GET(RX_ATTENTION_INFO1_MCAST_BCAST, + __le32_to_cpu(attn->info1))); +} + static void ath11k_dp_service_mon_ring(struct timer_list *t) { struct ath11k_base *ab = from_timer(ab, t, mon_reap_timer); @@ -3468,6 +3478,7 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar, u8 tid; int ret = 0; bool more_frags; + bool is_mcbc; rx_desc = (struct hal_rx_desc *)msdu->data; peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); @@ -3475,6 +3486,11 @@ static int ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar, seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); + is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); + + /* Multicast/Broadcast fragments are not expected */ + if (is_mcbc) + return -EINVAL; if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || -- 2.30.2