From patchwork Thu Feb 15 14:13:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 201497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp432316dyb; Thu, 15 Feb 2024 06:22:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXm/cpemOpIiItXOiglc5JpDYcvyDuY+lgXwCB4FjEwD72wA4XIBhaloRlWACrXCz9FVvHgFlkP/l/lmyp+WY801SnWMg== X-Google-Smtp-Source: AGHT+IF7Vu1v4MNAvukRQQiwFI/2dGqwVJTTHMmr7YfpBuH6DHns3XvJh/o4Vps3RyHgB0Of9W35 X-Received: by 2002:a05:6a00:1da9:b0:6e0:9902:d7ce with SMTP id z41-20020a056a001da900b006e09902d7cemr2568434pfw.10.1708006923613; Thu, 15 Feb 2024 06:22:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006923; cv=pass; d=google.com; s=arc-20160816; b=x7cHAJYQkEMo2NuflMhpaNdDXLMviOAc+wtawA9hXxItdw3FXG32FScrLHAY57OvRH sSpEylE/DdGwPi0gz6AN9JMJTpE7sDSnyVsBVBeMvyp6EF1Hvf2JCTFvzNJFwxeyoN82 9yRX25nMac4nko5LJVSJXZ3pkkm29sXhUBUKSOqPkSxJRoXE+jUt3C/dohBDcb6ihX5i LKs1xV3VJK4OgN7RNp+EeZNcss4OnysJAM8gl7Z6NKwQbMvqp/82X4rwnTBnYiLwj/ul WTRHtEdRiLKVh2TA20GbN52WeXSNIL3EzRhjC6Bv1ztBF9BHgALuPj0Qia4J1O/p42Lp kCSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=FXP2gPLBFEVoi3fyWxeX+9N2//T08FGxLjrXEVgziMc=; fh=SNZimtkZ9hrFGveQNJEzqjlPzYQxW6uq0Dl9oXdMab8=; b=JbXwkYPGtlo6HmPPgdTsicrNhpA9Ka2aWRSRD28XFqa7IieYhINt1gBDxKqI1IyPw2 tlcp5fIwfjbA3VGe0KNZzewhflWZ8oJg1ybmXL5UkQwfCgoavn0QyZs9amjv2Fhv6aMn NAJd8Kb6C7VZrzRNEt6b3Tpo8h6O8nyuNpESvtv/5oYd9mb+iMGPQrG8G7DwSF9bRw1G /tao3dohbnZlU4Ucgtbp7tc+DUR8ClAVahlBGGVCt0WXlFac6oSDwpa7P0khL1GmOdUi nDGmB1+SSvvml5rXiUkJ9NLcosbMq4bgxmUFZSOosyVwEzkUMpQiygouwRrcntuOQqt9 jYfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CAkj2+hm; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67066-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67066-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c19-20020a62e813000000b006e07eb192fasi1182310pfi.165.2024.02.15.06.22.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:22:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67066-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CAkj2+hm; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67066-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67066-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 58283282EE9 for ; Thu, 15 Feb 2024 14:15:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BB9E132C04; Thu, 15 Feb 2024 14:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CAkj2+hm" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1E02130ADA; Thu, 15 Feb 2024 14:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006466; cv=none; b=FdTUmVZQVifWpkS7+CqlAdj0gFoeR6KbP8P372R78S7aEVzA/lG45BWlo/p5u4mSYw3XMFtAaIKI53maiuNKeHXwztzTkJQGYjr8vVD+qT3RMiMAj6lH09AXaRre0sHnIQf9ejYRHHiivyJ70TB5q5JC6JWQZSdY+w9m7lSRwA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006466; c=relaxed/simple; bh=EMBLwevEY0zUQ/hVqUx05ubdMW0u9n/ytRqgi5tBFGY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d69bi2fDmGP7Nq+vyMgooHSDaYb2L2U8A3GH9q7Z7garhsneDGTCk9fcLJIN8bGMaAPTniYyhI69pYD8UJCHQMb+gkIv1SBQC+WiQUH2asEcU6L4lA1vmT02w5aOIL7DowmqAvtvfnEXxmV1+lQKQlp6P4eK1aXRg/YnJm2rK2o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=CAkj2+hm; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id A11686000E; Thu, 15 Feb 2024 14:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708006462; 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: in-reply-to:in-reply-to:references:references; bh=FXP2gPLBFEVoi3fyWxeX+9N2//T08FGxLjrXEVgziMc=; b=CAkj2+hmxuAnKP13edn3CL4etwko857Qu21F7Javyn60cvNa1t3TCpLbL41EPsVYYdBcB4 Z3DoiZuR8ZwVfRxVy0W/IcH3rwwC322JvsbjtAxgfhgd84QC2l2yDF/O8MiHKLebVDyVRp 1hMjOei6OK28ugswa9qHn+8rBl0iG1mhUjaZDp4L8zt0SXTh7OqyBJQB1knvgSwiykFzDk nK8/m/bzJBaMgs0M5UhuIxMoog7h+yuHERX31qiR/gEGNTqcdyCTIudbBZOAxUBnONNZYE PpR+d91fkfMSRcHO6trBdgvLtBwvaFtBYNGrA5mf3dwyj14MmsWQJ5s5p7lP0g== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Thu, 15 Feb 2024 15:13:52 +0100 Subject: [PATCH 1/2] wifi: nl80211: force WLAN_AKM_SUITE_SAE in big endian in NL80211_CMD_EXTERNAL_AUTH Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-nl80211_fix_akm_suites_endianness-v1-1-57e902632f9d@bootlin.com> References: <20240215-nl80211_fix_akm_suites_endianness-v1-0-57e902632f9d@bootlin.com> In-Reply-To: <20240215-nl80211_fix_akm_suites_endianness-v1-0-57e902632f9d@bootlin.com> To: Johannes Berg Cc: Ajay Singh , Kalle Valo , Thomas Petazzoni , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Mitsyanko , Sergey Matyukevich , =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790975067751694337 X-GMAIL-MSGID: 1790975067751694337 User-space supplicant (observed at least on wpa_supplicant) historically parses the NL80211_ATTR_AKM_SUITES from the NL80211_CMD_EXTERNAL_AUTH message as big endian _only_ when its value is WLAN_AKM_SUITE_SAE, while processing anything else in host endian. This behavior makes any driver relying on SAE external auth to switch AKM suite to big endian if it is WLAN_AKM_SUITE_SAE. A fix bringing compatibility with both endianness has been brought into wpa_supplicant, however we must keep compatibility with older versions, while trying to reduce the occurences of this manual conversion in wireless drivers. Add the be32 conversion specifically on WLAN_AKM_SUITE_SAE in nl80211 layer to keep compatibility with older wpa_supplicant versions. Suggested-by: Johannes Berg Signed-off-by: Alexis Lothoré --- Only a few minor modifications from Johannes' initial suggestion: - fixed unbalanced parenthesis - slightly reworded the inlined documentation --- net/wireless/nl80211.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5f18cbf7cc3d..046ce0513d31 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -20136,9 +20136,26 @@ int cfg80211_external_auth_request(struct net_device *dev, if (!hdr) goto nla_put_failure; + /* Some historical mistakes in drivers <-> userspace interface (notably + * between drivers and wpa_supplicant) led to a big-endian conversion + * being needed on NL80211_ATTR_AKM_SUITES _only_ when its value is + * WLAN_AKM_SUITE_SAE. This is now fixed on userspace side, but for the + * benefit of older wpa_supplicant versions, send this particular value + * in big-endian. Note that newer wpa_supplicant will also detect this + * particular value in big endian still, so it all continues to work. + */ + if (params->key_mgmt_suite == WLAN_AKM_SUITE_SAE) { + if (nla_put_be32(msg, NL80211_ATTR_AKM_SUITES, + cpu_to_be32(WLAN_AKM_SUITE_SAE))) + goto nla_put_failure; + } else { + if (nla_put_u32(msg, NL80211_ATTR_AKM_SUITES, + params->key_mgmt_suite)) + goto nla_put_failure; + } + if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || - nla_put_u32(msg, NL80211_ATTR_AKM_SUITES, params->key_mgmt_suite) || nla_put_u32(msg, NL80211_ATTR_EXTERNAL_AUTH_ACTION, params->action) || nla_put(msg, NL80211_ATTR_BSSID, ETH_ALEN, params->bssid) || From patchwork Thu Feb 15 14:13:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 201493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp427699dyb; Thu, 15 Feb 2024 06:15:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuRCRWaSgVuFOTVgoYbiswMhdsjoxF48O207KrGnlOQOPhfKvIOX75hx+skbLzTYrDxuOl1FsUkgllQNxsJag65OoBeQ== X-Google-Smtp-Source: AGHT+IH7+gJaXvR3sjSN4dyDBuSY9h4J6EJsJ9V84HCYI0WtG3QeEM7m7aIJTg7nFK1TH+AT0pqJ X-Received: by 2002:a05:6512:b88:b0:512:8de1:2714 with SMTP id b8-20020a0565120b8800b005128de12714mr45140lfv.24.1708006521073; Thu, 15 Feb 2024 06:15:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006521; cv=pass; d=google.com; s=arc-20160816; b=Xuw/0Ae6QXtROeODoCSAy1rZt/3og7a0aVZH0ZkgW5ffMR2O5kDXpHMqGlu3mCHsL9 uVcl22DtNuulwBC/5PiArd4G097ESuIjoI3tCQWXocK79132kEiDud8p+QtBcD4NXkv7 3miRK7cAv0Id/elPhMHXQHqFN02BpaSzyyuvGjKx71bEMPpSw0W1h3RMysBYUIimhzGB 4RzQ2+jv7R0lUZX+vzuGXPjpVbUB7KWe1Trw6I12+pftyjtCThJ9Br1hrhmgN4eIuArP jXzHAz3NjSquOlwOj+j0xBBSxWi3vOhviZIN1sWadPnNPPHbYmeFITI4GA0ofhCYWgxI EO9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=NRqWFUm6aNd2iZs3bNrOnrrE0X4fa/zKmGGOIOEUt48=; fh=0Jc684PZ0UyZKb5WD2D62eGev2cx9K4j9+TOLh04mMo=; b=CMXKbEN45c/HqSIZs6Gleh/Tpa+zr8NRfPdI0XrBzwBwni7zToHtgvcCHNNVcpWyYX xLncfX7gJc6lvKj2Sir0L7U/v/92UwqA5kkr/TKtkRACHOkR+seR2a/l5WcZ7EkUkQQl Vz6tigaY9nPZeqoR3+Lwjmnab4Fos5w8FgpzNg5BcAt+ihpFkY858/gy8it57aZbRJKY N/GN4MCFYl9dx/tHIcFUW4mNquEm9YW2v3Zt2ViL3AEtWKCJ57zILG132rTxQf+RWR89 W7XQYGISjXGuZpYWnyTZsFfC8SadT+Q0YolpfNjNEiUEw/94aG29YAyNeuXgnG1lbEN3 2tpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cqwUUNub; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67067-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b18-20020aa7df92000000b0055f49c246f1si665408edy.624.2024.02.15.06.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:15:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cqwUUNub; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67067-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A621E1F213BB for ; Thu, 15 Feb 2024 14:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D5E0132C0B; Thu, 15 Feb 2024 14:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cqwUUNub" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79FD5131727; Thu, 15 Feb 2024 14:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006466; cv=none; b=CyFwVPfufOSf8jWNc4uUaG/fsNQQZEMUiTTLSaMy4r4yfmZDvLNCOICsJKx6a6fhFDqezT91+JBAli7yyIlZGyYUaZZP6jOZ5WizTcueVVliWjOz5QLiB4XZ++BtJmQEzk98HWrihkqag0IHUxytH/JZV7Q0IHCjzmi3oZQWe00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006466; c=relaxed/simple; bh=t3Zyfq1flidLj2HJeYGumwpQFqjehsUbkuEswwX6ibc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aT4g+IILHZAWWq5Z5msF3dQcPEm1juVYzVwNZ9MuDu41nu3nhpcat0Gd6h+MXMMVX5ijw0nnyWd/7bsKtxmWCDa5DXmBYHhffDEwmgSiDjLSMXL2YdFSot9KaH/ikL+JHMRdFZZAaQZ/HFY+e0zXtN3QucQwDT8bBWXUE1OTsZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cqwUUNub; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 321DA60008; Thu, 15 Feb 2024 14:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708006462; 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: in-reply-to:in-reply-to:references:references; bh=NRqWFUm6aNd2iZs3bNrOnrrE0X4fa/zKmGGOIOEUt48=; b=cqwUUNub4BGRoLFqoqtgc+yWruEgnDpy9FAO7POq7+WalF28f1RZ5um9ioRiKR2EeBmFAY 4AE2By7uWnsmGNb2n0V6xVVF/VQ648hC4tRjJZqwBuywwu2oMKIQDzM4uNA43zbzXjHZC8 Dk3gcIW5XsZIB2w89xDBNVayArH6U3lnCw/noJBy43YWlm89Z0vh5Wk3I+qZWPxVvN4Ha2 fjdsOUlTgb8goH0nlP4PBFzc1fhHxPxaihvQO40Tmv/ug4Xmx1cjP1y60uQI2taRUGlanN yPDD0OOtB2Kw+mOyvJE1c5czw7TOBHa/qKYNyrAEOwsDOgAbUIXfyoaAq35FXQ== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Thu, 15 Feb 2024 15:13:53 +0100 Subject: [PATCH 2/2] wifi: wilc1000: remove AKM suite be32 conversion for external auth request Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-nl80211_fix_akm_suites_endianness-v1-2-57e902632f9d@bootlin.com> References: <20240215-nl80211_fix_akm_suites_endianness-v1-0-57e902632f9d@bootlin.com> In-Reply-To: <20240215-nl80211_fix_akm_suites_endianness-v1-0-57e902632f9d@bootlin.com> To: Johannes Berg Cc: Ajay Singh , Kalle Valo , Thomas Petazzoni , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Mitsyanko , Sergey Matyukevich , =?utf-8?q?Alexis_Lothor=C3=A9?= , kernel test robot X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974645829855799 X-GMAIL-MSGID: 1790974645829855799 The driver currently raises the following sparse warning: [...] cfg80211.c:360:42: warning: incorrect type in assignment (different base types) [...] cfg80211.c:360:42: expected unsigned int key_mgmt_suite [...] cfg80211.c:360:42: got restricted __be32 [usertype] CHECK drivers/net/wireless/microchip/wilc1000/netdev.c This conversion was needed because historically the external supplicant (observed with wpa_supplicant) expects AKM suite as big endian in NL80211_CMD_EXTERNAL_AUTH message when the AKM suite is WLAN_AKM_SUITE_SAE. This is not needed anymore: - new (to be released) versions of wpa_supplicant now reads it in host endian _while_ keeping compatibility for older drivers - for new drivers used with current/old wpa_supplicant, this conversion has been added to nl80211 to force big endian when the AKM suite is WLAN_AKM_SUITE_SAE Remove this not-needed-anymore conversion to fix the sparse warning. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308290615.lUTIgqUl-lkp@intel.com/ Tested-on: WILC1000 hwB SPI WILC_WIFI_FW_REL_16_1-13452 Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index f03fd15c0c97..cb564e2bad29 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -356,7 +356,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, memcpy(vif->auth.ssid.ssid, sme->ssid, sme->ssid_len); vif->auth.ssid.ssid_len = sme->ssid_len; } - vif->auth.key_mgmt_suite = cpu_to_be32(sme->crypto.akm_suites[0]); + vif->auth.key_mgmt_suite = sme->crypto.akm_suites[0]; ether_addr_copy(vif->auth.bssid, sme->bssid); break;