Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9932317ybi; Wed, 24 Jul 2019 12:34:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/kV1oKRmJEhKKx/hiRSawL/2AkL9YZW5JhCrXnb62YKe7cnw1EWszxMaopxxcCUHmTDqy X-Received: by 2002:a65:44cb:: with SMTP id g11mr37395751pgs.288.1563996841246; Wed, 24 Jul 2019 12:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996841; cv=none; d=google.com; s=arc-20160816; b=Ny6PyFQ9O0k8SBgjG3bl0gwQ9TyIIqMgiUOR58/MgkgE0t9+HSkYjUfQJnT87IbU+R oSkpz+ojmBgbrJuE/AeHa2RP33ApRsCTF6lqQwsUpAAuGiAFoFA5joE6tLRqsWJdLin/ 3gO+OOwd3WOmx+LmviRplv6Vq4xtPUpmsWNv1ZXrb4FnBAEMt3etn5629T8q6BiBerEO vvSB7A2BqfRIPoc9JukDJ3VdaLNfqUJ1+kY6hIo3ghJJoB+GFA2TLHDrGiRdS6/GWrbx ddB9vNmk92NDYj226M78cXs+VxG12V3Mc/qTsVK2J1lcAu8ljUsevhW0RjLft+v/Fec0 parQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y6vCiPKeYz+fIIBEzIMS4qSXdoAB4FUbx89GoqZbuBw=; b=yYjMN7Ul0lFVPcwulGvoPr8JXvnUzFoYKR9oClrxGnpyO5f9V991LcjYUpD8t3jrJB bo27A5eKrwtHDDJq2aZ6d98KsnBVQlu5Ne1euDk7o6Uw69bRIEMS0scKd0iGnHEbmFNa 203WTrzPkmxzuGgP1+5FgFxccf5uzjeTSL90e0l0um2YO/QmLjRGTIFLrpoiK2hRuTMi VyJkTepzb53E8Lgc4ah21fvMFpDpEXx9+O473YEe5dWq7EK2R4vpoLEAdw0AIQkSNlkd 44WJpR0MGV8i8/rRKRiQUr9XRQgeN4vX1VL39ysIwluPSCSAahhhLehkdtwxZYam5loW F3qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v5UDs1Bf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si15588735plo.104.2019.07.24.12.33.46; Wed, 24 Jul 2019 12:34:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=v5UDs1Bf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388483AbfGXTbb (ORCPT + 99 others); Wed, 24 Jul 2019 15:31:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:52310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388459AbfGXTbZ (ORCPT ); Wed, 24 Jul 2019 15:31:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9BE532083B; Wed, 24 Jul 2019 19:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996684; bh=6+Wdk9P84D5keGPfCrFXElQqbeYWyusl5dcj9PAplls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v5UDs1BfeQ/1IbayQrXo2ZwwNEbIo8IX3ABRKz2jwji33BtnacjvHnc9B+ZhTAzYG 1IYVEgtpjWt2BLADDCCqPHS3Sv/oWxYODIwMLUi6V3jN2KQwfBx0FD8T52XpAEZzZO xOY+HZ8RGSTaw2RMI3QpVKCXetTUpBv1lPBwCocg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zefir Kurtisi , Kalle Valo , Sasha Levin Subject: [PATCH 5.2 182/413] ath9k: correctly handle short radar pulses Date: Wed, 24 Jul 2019 21:17:53 +0200 Message-Id: <20190724191747.822781683@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit df5c4150501ee7e86383be88f6490d970adcf157 ] In commit 3c0efb745a17 ("ath9k: discard undersized packets") the lower bound of RX packets was set to 10 (min ACK size) to filter those that would otherwise be treated as invalid at mac80211. Alas, short radar pulses are reported as PHY_ERROR frames with length set to 3. Therefore their detection stopped working after that commit. NOTE: ath9k drivers built thereafter will not pass DFS certification. This extends the criteria for short packets to explicitly handle PHY_ERROR frames. Fixes: 3c0efb745a17 ("ath9k: discard undersized packets") Signed-off-by: Zefir Kurtisi Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath9k/recv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 4e97f7f3b2a3..06e660858766 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -815,6 +815,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_hdr *hdr; bool discard_current = sc->rx.discard_next; + bool is_phyerr; /* * Discard corrupt descriptors which are marked in @@ -827,8 +828,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, /* * Discard zero-length packets and packets smaller than an ACK + * which are not PHY_ERROR (short radar pulses have a length of 3) */ - if (rx_stats->rs_datalen < 10) { + is_phyerr = rx_stats->rs_status & ATH9K_RXERR_PHY; + if (!rx_stats->rs_datalen || + (rx_stats->rs_datalen < 10 && !is_phyerr)) { RX_STAT_INC(sc, rx_len_err); goto corrupt; } -- 2.20.1