Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp554616rwb; Fri, 23 Sep 2022 00:17:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7mDTk3zd5xNOQwmj43coG8ZcDd9eNXCsrku80Qoah8RQwiguXzbpAV9IgiYiJJK6iYlMv/ X-Received: by 2002:a63:4042:0:b0:43b:ddc8:235 with SMTP id n63-20020a634042000000b0043bddc80235mr6474717pga.498.1663917470356; Fri, 23 Sep 2022 00:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663917470; cv=none; d=google.com; s=arc-20160816; b=N+MtEpl1k8CfFytDw7h39ma1bjxB5UqB6TlWrGPECe8K1T43Vo6ACymzwy2lpXrvUw M887rRltxGuPWe5U+ejhJdHRKWL7tbHH7Q4gfnc1VsD+AUB7MBzwoSHl/OTSYha74kha lgn/QUJYBdWKVtQd9HEy7W2jXIG4rzpPEQ4QGsTTc7lWezL+O8MzEycF2vJOr6244Y7a X4nGI7qJDdGzu1DoBJRYhZorXxm4LlYOrYAqqgQf4HAHNhVOB+eGbSHCLHxy5tY+ZBwH quEAUrDqov9Vg4RbmR6Cbw4egJDsak9rb7hflcF3cJNIf7i2Z04ETZZCaReEZBi7n7yb ABUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Q9XLgjH24Eqjg6RRtYVvfWduJ61UcgsEusT0WAtU5E8=; b=kYWWEAsudkXvZRlfge71CIrMek6qzNu5KEfq95kD5UmanFOu0Tn9qvukV7bBthGm9d 23t8VNd/w1uGvQndQNlEBhGOHyr+Do0aRiiko5gsLlI0w9yM/W97UeVvEiKcCxmfiz9/ C1O3vwhH3EC2iRMf5kNsvJ/C51qaWHYj+9Em2PQ1AUO5AP3sJ/T1Wk53rNRKOVC2noJu QuRk70aHmCVtI6oXjnqE+h6ryiWZZly9aVFtckhonWNESRw8/Zm6vL98DrsnS7geNX7x YkxUdTxJ/GcVBSoMqvxAekLllCPAwR1T5106hHnvK/Zy+AooI3k3S4FcprD4M7UGCYWm OGaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flowbird.group header.s=google header.b=hzeeuLSH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flowbird.group Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a170902cf0100b00176dd113d9fsi737743plg.461.2022.09.23.00.17.40; Fri, 23 Sep 2022 00:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@flowbird.group header.s=google header.b=hzeeuLSH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flowbird.group Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbiIWHMD (ORCPT + 62 others); Fri, 23 Sep 2022 03:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbiIWHMC (ORCPT ); Fri, 23 Sep 2022 03:12:02 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC99B12386B for ; Fri, 23 Sep 2022 00:12:00 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id w8so18351690lft.12 for ; Fri, 23 Sep 2022 00:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flowbird.group; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Q9XLgjH24Eqjg6RRtYVvfWduJ61UcgsEusT0WAtU5E8=; b=hzeeuLSH4lw7vzdJ93tAxggaRfrX4k3h+rzmlZJLjzINbxknhshkYu3oCP7+31RfjJ VimAgUp4uDylHufMWezg76DnXXXzlz42gFLHTrt4Qt+iJ+GMwXHzWzawWeYId63gsluG 05Nd3tenY+qHIynBjcMp4cb2ZtWLyWthQGpwXC8PQFme5swtbcuk6e4JN581Ys0DAJAO nFggqgYNZwqD+IHBkvjmWC/uZySF8ODpOgQu7qdpRcOSJ+9aFB1FFj2Nwzg8WZEHqcuu DwP7jIE1B/sTaaiDXaDcbk/ICUIyFRDIfZJDga03qBmS5qeRqn3azPty7NrnaTw0Y/+8 Ov1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Q9XLgjH24Eqjg6RRtYVvfWduJ61UcgsEusT0WAtU5E8=; b=7Pq+OBGJQZfu/Ng+IKQqQCrKRbG7R1wOz00f2OXDWlG/q22x0eNN61DFxOO0gupRBo 3K0WUhA5Wkssr8H8mbJkVJDHKiCnOJZeKxNTuCTquwaP7U9zlNqsrMeYGon4ec/p0KHn UH+WMIuUD1ToAITN5u1+Oy0+y49g2D2Bun78XhGDyMeue/XK1ezRFk6lm+7rZOa56IVr jTRR5BlLJdkkf52adCSd3qlF3exxsLgFGOSy6hcEM2TyYQ01yTDP0DcmKK9G7o7U5Xg6 yjhqhkdJCv722qtCW8QeBYJSyQPJXy2iZUwf+AC5k9Td9bS6698fZS8wj2/tE0lKGvDm IUFQ== X-Gm-Message-State: ACrzQf2IrfOObf8rrRWB7zU8uXf8FYXFazFB6RuHl/eaLe7ShVVswZJv yzbw5aUAQmPVpqoEcTZFb3rVtrC28XYgc0PTF8WGk7AGVXE= X-Received: by 2002:a05:6512:685:b0:49f:4929:4c6e with SMTP id t5-20020a056512068500b0049f49294c6emr2890888lfe.642.1663917119095; Fri, 23 Sep 2022 00:11:59 -0700 (PDT) MIME-Version: 1.0 References: <20220922203240.108623-1-marex@denx.de> In-Reply-To: <20220922203240.108623-1-marex@denx.de> From: "Fuzzey, Martin" Date: Fri, 23 Sep 2022 09:11:48 +0200 Message-ID: Subject: Re: [PATCH] wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port To: Marek Vasut Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Angus Ainslie , Jakub Kicinski , Kalle Valo , Martin Kepplinger , Prameela Rani Garnepudi , Sebastian Krzyszkowiak , Siva Rebbagondla , netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Marek, On Thu, 22 Sept 2022 at 22:33, Marek Vasut wrote: > > When using wpa_supplicant v2.10, this driver is no longer able to > associate with any AP and fails in the EAPOL 4-way handshake while > sending the 2/4 message to the AP. The problem is not present in > wpa_supplicant v2.9 or older. The problem stems from HostAP commit > 144314eaa ("wpa_supplicant: Send EAPOL frames over nl80211 where available") > which changes the way EAPOL frames are sent, from them being send > at L2 frames to them being sent via nl80211 control port. ... > Therefore, to fix this problem, inspect the ETH_P_802_3 frames in > the rsi_91x driver, check the ethertype of the encapsulated frame, > and in case it is ETH_P_PAE, transmit the frame via high-priority > queue just like other ETH_P_PAE frames. > > diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c > index 0f3a80f66b61c..d76c9dc99cafa 100644 > --- a/drivers/net/wireless/rsi/rsi_91x_core.c > +++ b/drivers/net/wireless/rsi/rsi_91x_core.c > + > if (skb->protocol == cpu_to_be16(ETH_P_PAE)) { > + tx_eapol = true; > + } else if (skb->protocol == cpu_to_be16(ETH_P_802_3)) { > + hdr_len = ieee80211_get_hdrlen_from_skb(skb) + > + sizeof(rfc1042_header) - ETH_HLEN + 2; > + eth_hdr = (struct ethhdr *)(skb->data + hdr_len); > + if (eth_hdr->h_proto == cpu_to_be16(ETH_P_PAE)) > + tx_eapol = true; > + } > + > diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c > index c61f83a7333b6..d43754fff287d 100644 > @@ -168,6 +171,16 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb) > + if (skb->protocol == cpu_to_be16(ETH_P_PAE)) { > + tx_eapol = true; > + } else if (skb->protocol == cpu_to_be16(ETH_P_802_3)) { > + hdr_len = ieee80211_get_hdrlen_from_skb(skb) + > + sizeof(rfc1042_header) - ETH_HLEN + 2; > + eth_hdr = (struct ethhdr *)(skb->data + hdr_len); > + if (eth_hdr->h_proto == cpu_to_be16(ETH_P_PAE)) > + tx_eapol = true; > + } > + It looks like the same logic is being duplicated twice. Maybe create a helper function for it, something like bool rsi_is_eapol(struct sk_buff *skb) ? Also I think it would be good to tag this for stable. Martin