From patchwork Fri Nov 1 11:11:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 11222901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1036D14E5 for ; Fri, 1 Nov 2019 11:11:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E170820659 for ; Fri, 1 Nov 2019 11:11:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UDhT/j1m"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=c0d3.blue header.i=@c0d3.blue header.b="Diosam2E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E170820659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=c0d3.blue Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3m8KarzUUNxNnfxtrOYP8B1816YAkdCtdVSKJUpuccc=; b=UDhT/j1mSFOK30 lgPpQt8KOEjq6wJpaI8F3wjQC872N6ic/t5svCUqTt3IKQ7lwfufbwQed6SQwbtcjEnhSP+mZoMH2 8aX55VAoXOOqbHM9RsRpbgI6FVNEgu0XJZSxApEm8ZCGDbcDiX1EAAXnzzo5qSJfrj5WizdO4xT5l 16siohgHtgcEDuHQ1fQa0JK21uue5iYhItkzWyHwqshR4VffgO4hn2SZ++ZMVSDNDPRrJmSjDxAyn cNIuWJtnNTp/wzY4xz7jeWreM1JDO+yzpzoSEv4gLU5tIvZ2g34fakYQx5EFWbSZ1HnKEhH3DvRqE 8MjUqmynYkQcfi0IRy+A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQUqS-0008VK-3H; Fri, 01 Nov 2019 11:11:56 +0000 Received: from mail.aperture-lab.de ([2a01:4f8:171:314c::100:a1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQUqP-0008U1-2C for ath10k@lists.infradead.org; Fri, 01 Nov 2019 11:11:55 +0000 From: =?utf-8?q?Linus_L=C3=BCssing?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c0d3.blue; s=2018; t=1572606705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oeilr/v60IUH+v4nJU3swyG8i/es5QRl2RumVH9+VoI=; b=Diosam2ExOu4kg+DsdPbSrTiUOlzMH/WShPtt51TamqMehqhDxfZgBAVW17tr/UBZNGz08 XTwA8MeXhASPpHvpz17zcwT9yuvu1RqdQDYodTqn4Lqvewjzf/Sit1K38lfq6IciqjS8AL ojpDu5N1wCnqQWDchWlYHK8KWb7HAzRJ11XojfpFcDK5hk+9vBUQrF76NMdDY54x007di+ SMy3Dja22F73vq4NcQbMAfGJPd1jxfCJRi3xbLK2t+LEiNfHCvgdZ0q09EhQi2h8Ic2h/j W1RdnnvYUpmiPQdk6HyGACa6NNHmPsKQhFeUWoV5dKeCySm0ryw65zQr5vv7VA== To: ath10k@lists.infradead.org Subject: [RFC PATCH] ath10k: fix RX of frames with broken FCS in monitor mode Date: Fri, 1 Nov 2019 12:11:38 +0100 Message-Id: <20191101111138.9086-1-linus.luessing@c0d3.blue> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=c0d3.blue; s=2018; t=1572606705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oeilr/v60IUH+v4nJU3swyG8i/es5QRl2RumVH9+VoI=; b=hR7/wWp+H2YlsNuD1sw/f8CKSnWLwx9+j3sGX7gOyF9qwuG4yOqnZyzxqDM6iKj/+fQoFf mXsfT+xC8TM7hRQ1H3aAcxHdJFZ6rIn+g3B5NJprFmh5yi1eq7BaFX71vt9gdniZOJwF7n u12SB2TvQmyOOd46T2CFF0hIMtBlWzNdxB5OqLhRTTg16oc636kNjlqAAtYnm5EYF/CQDC 4Mfm2QEJUcva3epoEr7Rni3chpMl2YdHua9Mlo7ArfrPp6PH8F5V3MXJ7Gz7ukym1a3foE hnDnYyEw9q4Sfh6sR5Y9yFlyhksXA0oWh+jCw+uNw7KfJUon6Br7fjafoAUKBQ== ARC-Seal: i=1; s=2018; d=c0d3.blue; t=1572606705; a=rsa-sha256; cv=none; b=haQYVenNgSKVb+X3GLQrNF987/86uKV4VJMl62Y2btvU1Gt308jIFbdvJ0T82lMy61DDyl M/qu3mks5jn8pahLtyl2b8Wae6yDMhas4bCrAhchbYomVPsMDbRhJQ7r1sSdRvUIUsCf0N WoeIYQmtXWtLw/C2W9UjWKiMDC2eFjG10xIBOnBBxu+xVTRZyyII2KRr0m2K5QfFtG0HwX oPhkj8lg+Ay3fBFSUlBy8ykWUEWDc8tf3bGt+pN6xpNT2v6bznhGK/1rwhaQh5T3vXXkL4 7jUxsTBv+VchkTSbTQDK/R2cbCZQS5mI83dSTQmPQp5kpGJJAGxJYnf6J1O4hQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=linus.luessing@c0d3.blue smtp.mailfrom=linus.luessing@c0d3.blue Authentication-Results: ORIGINATING; auth=pass smtp.auth=linus.luessing@c0d3.blue smtp.mailfrom=linus.luessing@c0d3.blue X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191101_041153_445817_E3706168 X-CRM114-Status: UNSURE ( 7.18 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a01:4f8:171:314c:0:0:100:a1 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Linus_L=C3=BCssing?= , Simon Wunderlich Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org From: Linus Lüssing So far, frames were forwarded regardless of the FCS correctness leading to userspace applications listening on the monitor mode interface to receive potentially broken frames, even with the "fcsfail" flag unset. By default, with the "fcsfail" flag of a monitor mode interface unset, frames with FCS errors should be dropped. With this patch, the fcsfail flag is taken into account correctly. Signed-off-by: Linus Lüssing --- This was tested on an Open Mesh A41 device, featuring a QCA4019. And with this firmware: https://www.candelatech.com/downloads/ath10k-4019-10-4b/firmware-5-ct-full-community-12.bin-lede.011 But from looking at the code it seems that the vanilla ath10k has the same issue, therefore submitting it here. I'm also not that familiar with the ath10k code yet. So not 100% sure if it's the right place for this check. Therefore sending as RFC. --- drivers/net/wireless/ath/ath10k/htt_rx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 53f1095de8ff..ce0a16ebb8bb 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -1285,6 +1285,12 @@ static void ath10k_process_rx(struct ath10k *ar, struct sk_buff *skb) status = IEEE80211_SKB_RXCB(skb); + if (ar->monitor && !(ar->filter_flags & FIF_FCSFAIL) && + status->flag & RX_FLAG_FAILED_FCS_CRC) { + dev_kfree_skb_any(skb); + return; + } + ath10k_dbg(ar, ATH10K_DBG_DATA, "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", skb,