Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2579510ybt; Mon, 22 Jun 2020 01:53:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW0Z86g7wKoARdhRm4Ye8YvhYKd0yuWEGMIGxwvDbSmVhZlVfCctFg8qBnpspXLkT/aUav X-Received: by 2002:aa7:c790:: with SMTP id n16mr16471820eds.54.1592815989239; Mon, 22 Jun 2020 01:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592815989; cv=none; d=google.com; s=arc-20160816; b=ewvG6jPmClDSq6X61rVaMmFj2cHualTjbndZ8VLRT3LUbhVNYf5XM8TpWIiFNV2na8 XxrN14kGudwFUc9gO1K4g1gcuX4NyetiUOFCkDwY8WEEmBj93QvGCuuB14MHnNkBXPRk 8K+edhxT8RGlVX+3eayGltF3wlOmO1y322VDEKhoPVIhGVmZzm4BnLmHDXsUQVn+V0al KWX5auS9/r2bvPozVL8f7Cf4HNfP6VrGsCbeTHnN9XN45vnmPvCTCnh3srDsP4N3E8VX BWD61UikoS2Rwxc+qmIIF2bEmxDm6KzND+KAa4ZZ3G1eyw/b782KixM7C6Qrgre1lEbF 6NtQ== 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 :message-id:date:subject:cc:to:from; bh=OD6bStJLnJMQXaARU/wLgPZv8aROZ3ygubYQCoEkhRs=; b=luPO6E5UK8F/2gk8OFdDCx84HbnqJsh77BuWAsVywGUeQYSraIekuhefMwyheG8ist tfeM96HfQsVne5J2tf8SIJ44Mwl/0L+gGFIsOJ/3Ov/sxqAcD0lVBPz7eB5TJ4YEXx1a zR9FojWp3lN/4Qpz85xIL7mgiZ8nust7rma1I08/ZVu6SwtrPzgt3ZrQfGZsaljsMJ7N ai71UWDQqSx+HvZ7qptsHNtDLFpMAMbT+5aZGh4irjP/Qht2piiNDDYMiKOhqsbUAm4V 3V42gbo0T8egS0YCyJUuSgbl1/xb2xK5LCaHqD+BV7Jvu5C0GzoNgv6LaYkzooolEwIo EdLw== 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 m17si4940009ejj.153.2020.06.22.01.52.40; Mon, 22 Jun 2020 01:53:09 -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 S1726110AbgFVIuP (ORCPT + 99 others); Mon, 22 Jun 2020 04:50:15 -0400 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:55745 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgFVIuO (ORCPT ); Mon, 22 Jun 2020 04:50:14 -0400 Received: from legolas.fritz.box (unknown [79.211.69.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id CC96058007E; Mon, 22 Jun 2020 10:50:12 +0200 (CEST) From: Markus Theil To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, j@w1.fi, Markus Theil Subject: [PATCH v2] mac80211: fix control port tx status check Date: Mon, 22 Jun 2020 10:49:33 +0200 Message-Id: <20200622084933.118413-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The initial control port tx status patch assumed, that we have IEEE 802.11 frames, but actually ethernet frames are stored in the ack skb. Fix this by checking for the correct ethertype and skb protocol 802.3. Fixes: a7528198add8 ("mac80211: support control port TX status reporting") Reported-by: Jouni Malinen Signed-off-by: Markus Theil --- v2: use __be16, as suggested by Johannes Berg net/mac80211/status.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 7b1bacac39c6..ff4362d0a0ee 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -639,11 +639,22 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie; struct ieee80211_sub_if_data *sdata; struct ieee80211_hdr *hdr = (void *)skb->data; + __be16 ethertype = 0xffff; + + if (skb->len >= ETH_HLEN && skb->protocol == cpu_to_be16(ETH_P_802_3)) + skb_copy_bits(skb, 2 * ETH_ALEN, ðertype, ETH_TLEN); rcu_read_lock(); sdata = ieee80211_sdata_from_skb(local, skb); if (sdata) { - if (ieee80211_is_any_nullfunc(hdr->frame_control)) + if (ethertype == sdata->control_port_protocol) + cfg80211_control_port_tx_status(&sdata->wdev, + cookie, + skb->data, + skb->len, + acked, + GFP_ATOMIC); + else if (ieee80211_is_any_nullfunc(hdr->frame_control)) cfg80211_probe_status(sdata->dev, hdr->addr1, cookie, acked, info->status.ack_signal, @@ -654,12 +665,8 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, skb->data, skb->len, acked, GFP_ATOMIC); else - cfg80211_control_port_tx_status(&sdata->wdev, - cookie, - skb->data, - skb->len, - acked, - GFP_ATOMIC); + pr_warn("Unknown status report in ack skb\n"); + } rcu_read_unlock(); -- 2.27.0