Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3288089ybb; Tue, 31 Mar 2020 02:09:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuli9FaEmJslo5DGgym0CxwsIP0JS20QoePOergxlfRljIZpxb8tVGaOYXdeSZ2OSvV+1do X-Received: by 2002:a9d:f05:: with SMTP id 5mr11871065ott.263.1585645783851; Tue, 31 Mar 2020 02:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645783; cv=none; d=google.com; s=arc-20160816; b=lWWY8zWfyqn6we6C46kRead9f5D5bhlpLLjFg3vuxiwwX5ucsYZMMV1vQ6QPMB4gP0 MDi6e7XkBnwKf3f8pDORetwfgxtO6axMmbeeGkYQznswBdE8B6nGxj6Jr+9aiUPHbaQK oFUIbg24bcv/gbqK2XkkFh8/GnN0TX1WMUHxnEyMY2UevZXx6aNzFzROCzTXoE/yvYTP z0fm9Src5yXuIIQHeBQRVhKSUqi4vl0ugkZEBwS489eFISRGfihueBuNAXvEOBUEkMVI hZHpJ5S+rc17Gkem6vG2htKBO/4XYGpahGf0K7/o/QyFXdB29n0SAD95gIT/xyXnZO8I Y6qA== 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=hADT8VC5vvNA54wROJ1e9mxliaDIDE8EceD+1E6T7+A=; b=VHIMcnThc902R72ZSXGi/heKTXT7gw6xdi89FNR8YUns8vOesI2wzffSyde6Dvh4hO /+viSurHRD+qIXY4obCJfgOq1EZMYMZbyyooxP/0dc+wdLwMU4ZStov+fimSrR7RvDyT 5ugOcM5pCNo+UVc4d2hbwdEWevfJ1Org+ezjCvefFQpbziy+50sw9zNz4znvcTOEbjOr EN0NTTh7621robpcpmxqLIvmlZEY1zubbEgpwN+Xg2jOKuPYrpCq7k+dVbAc+WWjMqFi YLcw0bAVxnmInYknYIH2BxKAJQ9GmgPr1fy6eeTuMnPIs7joni+q6h8aiR/bzZXaaof7 uaOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LTBXg0C6; 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 n70si7369942ota.89.2020.03.31.02.09.31; Tue, 31 Mar 2020 02:09:43 -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=LTBXg0C6; 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 S1731210AbgCaJIR (ORCPT + 99 others); Tue, 31 Mar 2020 05:08:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:50482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731297AbgCaJIO (ORCPT ); Tue, 31 Mar 2020 05:08:14 -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 7225420675; Tue, 31 Mar 2020 09:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645692; bh=qPbhfLNJ0jyHsJx0PP5QbD3l73Dd0Do+DUUDEMyqlRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LTBXg0C6y7kWSaNccLLuYYEXe6IxZ93GQaNqE4sdEd/3tK1LZwrjBNN4Jqk25WaUf xlT9NufjCOIr/UkLacf3UFJUNjmTI5G1lyKHhb1dYR7BCh8C0KV6fsSZ/3Voh1gDHL ZNK7Vr5apl5Z4WxwwuyQYpniR0cHIl9yuuIZMUJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg Subject: [PATCH 5.5 134/170] mac80211: set IEEE80211_TX_CTRL_PORT_CTRL_PROTO for nl80211 TX Date: Tue, 31 Mar 2020 10:59:08 +0200 Message-Id: <20200331085437.821400232@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@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 From: Johannes Berg commit b95d2ccd2ccb834394d50347d0e40dc38a954e4a upstream. When a frame is transmitted via the nl80211 TX rather than as a normal frame, IEEE80211_TX_CTRL_PORT_CTRL_PROTO wasn't set and this will lead to wrong decisions (rate control etc.) being made about the frame; fix this. Fixes: 911806491425 ("mac80211: Add support for tx_control_port") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200326155333.f183f52b02f0.I4054e2a8c11c2ddcb795a0103c87be3538690243@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/tx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -5,7 +5,7 @@ * Copyright 2006-2007 Jiri Benc * Copyright 2007 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018, 2020 Intel Corporation * * Transmit and frame generation functions. */ @@ -5135,6 +5135,7 @@ int ieee80211_tx_control_port(struct wip struct ieee80211_local *local = sdata->local; struct sk_buff *skb; struct ethhdr *ehdr; + u32 ctrl_flags = 0; u32 flags; /* Only accept CONTROL_PORT_PROTOCOL configured in CONNECT/ASSOCIATE @@ -5144,6 +5145,9 @@ int ieee80211_tx_control_port(struct wip proto != cpu_to_be16(ETH_P_PREAUTH)) return -EINVAL; + if (proto == sdata->control_port_protocol) + ctrl_flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO; + if (unencrypted) flags = IEEE80211_TX_INTFL_DONT_ENCRYPT; else @@ -5169,7 +5173,7 @@ int ieee80211_tx_control_port(struct wip skb_reset_mac_header(skb); local_bh_disable(); - __ieee80211_subif_start_xmit(skb, skb->dev, flags, 0); + __ieee80211_subif_start_xmit(skb, skb->dev, flags, ctrl_flags); local_bh_enable(); return 0;