Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1687616rwb; Mon, 7 Nov 2022 04:47:09 -0800 (PST) X-Google-Smtp-Source: AMsMyM5IXpvH35I1AV8tvjebfNZf0CW1eVzeXvAqtslbGmL04gKW4zIZaQHkWU2kPamPWN1RjZkr X-Received: by 2002:a17:906:794a:b0:7a0:72b8:2368 with SMTP id l10-20020a170906794a00b007a072b82368mr47481018ejo.601.1667825229441; Mon, 07 Nov 2022 04:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667825229; cv=none; d=google.com; s=arc-20160816; b=V+l7sePuoKCBclnoHjKhICSOVrfz1TN87iVVpiNhCrqrwBju3TWw5g5+EDde6zh8TY Sckc0ycqGFk/l9t6r3bBHqH510UwRGHUd8djFi/PnFv1/gi983ZADwsTsagjtIk3L2cF yaEXbpFCFKFSlzrFZl58f0nE/HSmPLddW4OAQyvcO0nm5N7zuRo8vToyavWAU13+mWLe 5TST4P6m3bXKrThTMCUbSU/vehLPbmQhmVJ/6N2MgsZOnO+/wiNMFxQktMYOfJN4zv0Q 77ZZSyMQf1HFcoUlEE+IeaRVI3dAEjw0O3eOZngVi4QYhaUvi62XnRBsykDM7mcJ4yZI sO0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=qX/Lc7KuBilKaRxFXcSAbWEmMeksp+pnFuAb3FPHpFE=; b=nQCzuV7QZ80oTmkw0jrEa96Z5Sx/wqtahTXjW2DdQMM48Mqdww5WXFG4YJYE0UVmgl rvzd8j1/v+zaR8QJB5RGJe3Ub2eqZ4Mwlm1cwAsm17NgPNOG1Eq155HMF2ezIoN6A+cG Lj5MkhqjYfKF+B/RbU2juBebCmjUpuHXawsp3RW0Sy/H9sszmZ4DGSJH3GUI8mjSeY2F yR8PvJJqj3N67QTKJRo42saXeARO59ogTqLeR9X/eUF0vHzM+wZcqTExCmMvrRddZjvi w8Wb/9nVo4dnVKW5voKTRAQjdfaBAIsBgupROSxlAz2OmffBlTzeCUzdly91Xd+q23xl F4uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FelJuhxK; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a50e609000000b00457e9f88b90si9116047edm.246.2022.11.07.04.46.51; Mon, 07 Nov 2022 04:47:09 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=FelJuhxK; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232235AbiKGMhV (ORCPT + 67 others); Mon, 7 Nov 2022 07:37:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbiKGMhT (ORCPT ); Mon, 7 Nov 2022 07:37:19 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A887CEE36; Mon, 7 Nov 2022 04:37:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 469B061029; Mon, 7 Nov 2022 12:37:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68B75C433D7; Mon, 7 Nov 2022 12:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667824637; bh=xA25/VVL0qYxxCrpXdz6ciSZ4H10xYZeAAxjaaCmrEI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FelJuhxKtxMgkWwOtuD4O9C9g/JPZHUktOM114X1HRUVv98gp8F2qEXJLzqcX4A6h fwHrGmXP1i6tEiA0hY85NmeY5u+2/Bf5WWNdq4YHD7a/pRDkIgrnyu+9Cx8tIDwCZh ifCFujL5/KYf9Z+briHwSM8WT/U+Up++nM6eOeCvYjP4ALrEXx95DLeGXwkYn54lS/ iNRz9AiH8nUEW9UD/3s44T1dgf8gJoysmxUvA1Q1HRrJlSfLFn1Vv4rOU48fE76Qgn xz8tbu0UhB/NSRuEPLbBcqq2QUL2bX5NWTiV8I69u9JOqU6Ui0gHS/315jwtTAVYrZ bP9Fvl2Sr1TmQ== From: Kalle Valo To: Marek Vasut Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Angus Ainslie , Jakub Kicinski , Johannes Berg , Martin Fuzzey , Martin Kepplinger , Prameela Rani Garnepudi , Sebastian Krzyszkowiak , Siva Rebbagondla , netdev@vger.kernel.org Subject: Re: [PATCH v5] wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port References: <20221104163339.227432-1-marex@denx.de> Date: Mon, 07 Nov 2022 14:37:11 +0200 In-Reply-To: <20221104163339.227432-1-marex@denx.de> (Marek Vasut's message of "Fri, 4 Nov 2022 17:33:39 +0100") Message-ID: <87o7tjszyg.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Marek Vasut writes: > 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. > > An EAPOL frame sent as L2 frame is passed to the WiFi driver with > skb->protocol ETH_P_PAE, while EAPOL frame sent via nl80211 control > port has skb->protocol set to ETH_P_802_3 . The later happens in > ieee80211_tx_control_port(), where the EAPOL frame is encapsulated > into 802.3 frame. > > The rsi_91x driver handles ETH_P_PAE EAPOL frames as high-priority > frames and sends them via highest-priority transmit queue, while > the ETH_P_802_3 frames are sent as regular frames. The EAPOL 4-way > handshake frames must be sent as highest-priority, otherwise the > 4-way handshake times out. > > Therefore, to fix this problem, inspect the skb control flags and > if flag IEEE80211_TX_CTRL_PORT_CTRL_PROTO is set, assume this is > an EAPOL frame and transmit the frame via high-priority queue just > like other ETH_P_PAE frames. > > Fixes: 0eb42586cf87 ("rsi: data packet descriptor enhancements") > Signed-off-by: Marek Vasut > --- > NOTE: I am really unsure about the method of finding out the exact > place of ethernet header in the encapsulated packet and then > extracting the ethertype from it. Is there maybe some sort of > helper function for that purpose ? > --- > V2: - Turn the duplicated code into common function > V3: - Simplify the TX EAPOL detection (Johannes) > V4: - Drop the double !!() from test > - Update commit message > V5: - Inline the rsi_is_tx_eapol() again, undoes V2 change completely BTW did you test this on a real device? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches