lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13e8e0bb-b2a2-e138-75c0-54e61a5d679e@suse.de>
Date:   Tue, 14 Feb 2023 16:27:27 +0300
From:   Denis Kirjanov <dkirjanov@...e.de>
To:     Marc Bornand <dev.mbornand@...temb.ch>,
        Johannes Berg <johannes@...solutions.net>,
        linux-wireless@...r.kernel.org
Cc:     "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Kalle Valo <kvalo@...nel.org>,
        Yohan Prod'homme <kernel@...do.fr>, stable@...r.kernel.org
Subject: Re: [PATCH v4] Set ssid when authenticating



On 2/14/23 16:20, Marc Bornand wrote:
> changes since v3:
> - add missing NULL check
> - add missing break
> 
> changes since v2:
> - The code was tottaly rewritten based on the disscution of the
>   v2 patch.
> - the ssid is set in __cfg80211_connect_result() and only if the ssid is
>   not already set.
> - Do not add an other ssid reset path since it is already done in
>   __cfg80211_disconnected()
> 
> When a connexion was established without going through
> NL80211_CMD_CONNECT, the ssid was never set in the wireless_dev struct.
> Now we set it in __cfg80211_connect_result() when it is not already set.

A couple of small nits

> 
> Reported-by: Yohan Prod'homme <kernel@...do.fr>
> Fixes: 7b0a0e3c3a88260b6fcb017e49f198463aa62ed1
Please add a test description to the fixes tag

> Cc: linux-wireless@...r.kernel.org
> Cc: stable@...r.kernel.org
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216711
> Signed-off-by: Marc Bornand <dev.mbornand@...temb.ch>
> ---
>  net/wireless/sme.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/net/wireless/sme.c b/net/wireless/sme.c
> index 4b5b6ee0fe01..b552d6c20a26 100644
> --- a/net/wireless/sme.c
> +++ b/net/wireless/sme.c
> @@ -723,6 +723,7 @@ void __cfg80211_connect_result(struct net_device *dev,
>  			       bool wextev)
>  {
>  	struct wireless_dev *wdev = dev->ieee80211_ptr;
> +	const struct element *ssid;

Please use reverse xmas tree

>  	const struct element *country_elem = NULL;
>  	const u8 *country_data;
>  	u8 country_datalen;
> @@ -883,6 +884,22 @@ void __cfg80211_connect_result(struct net_device *dev,
>  				   country_data, country_datalen);
>  	kfree(country_data);
> 
> +	if (wdev->u.client.ssid_len == 0) {
> +		rcu_read_lock();
> +		for_each_valid_link(cr, link) {
> +			ssid = ieee80211_bss_get_elem(cr->links[link].bss,
> +						      WLAN_EID_SSID);
> +
> +			if (!ssid || ssid->datalen == 0)
> +				continue;
> +
> +			memcpy(wdev->u.client.ssid, ssid->data, ssid->datalen);
> +			wdev->u.client.ssid_len = ssid->datalen;
> +			break;
> +		}
> +		rcu_read_unlock();
> +	}
> +
>  	return;
>  out:
>  	for_each_valid_link(cr, link)
> --
> 2.39.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ