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: <769f1405-62fc-4457-a958-b644c706140f@bootlin.com>
Date: Tue, 10 Sep 2024 12:08:25 +0200
From: Alexis Lothoré <alexis.lothore@...tlin.com>
To: Marek Vasut <marex@...x.de>, linux-wireless@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
 Adham Abozaeid <adham.abozaeid@...rochip.com>,
 Ajay Singh <ajay.kathat@...rochip.com>,
 Claudiu Beznea <claudiu.beznea@...on.dev>, Conor Dooley
 <conor+dt@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Kalle Valo <kvalo@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Rob Herring <robh@...nel.org>, devicetree@...r.kernel.org,
 netdev@...r.kernel.org
Subject: Re: [PATCH v5 8/9] wifi: wilc1000: Register wiphy after reading out
 chipid

On 9/9/24 21:29, Marek Vasut wrote:
> Register wiphy after reading out chipid, so the chipid can be
> used to determine chip features and not advertise WPA3/SAE
> support to userspace on WILC3000. Note that wilc_netdev_cleanup()
> will deregister the wiphy in fail path.
> 
> Signed-off-by: Marek Vasut <marex@...x.de>

[...]

> @@ -1804,14 +1803,8 @@ static struct wilc *wilc_create_wiphy(struct device *dev)
>  				BIT(NL80211_IFTYPE_P2P_GO) |
>  				BIT(NL80211_IFTYPE_P2P_CLIENT);
>  	wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
> -	wiphy->features |= NL80211_FEATURE_SAE;
>  	set_wiphy_dev(wiphy, dev);
>  	wl->wiphy = wiphy;
> -	ret = wiphy_register(wiphy);
> -	if (ret) {
> -		wiphy_free(wiphy);
> -		return NULL;
> -	}

If I am reading the patch correctly, there are still some failure paths in
wilc_cfg80211_init which try to call wiphy_unregister on the (not registered
anymore in there) wphy.
>  	return wl;
>  }
>  
> @@ -1861,6 +1854,14 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
>  }
>  EXPORT_SYMBOL_GPL(wilc_cfg80211_init);
>  
> +int wilc_cfg80211_register(struct wilc *wilc)
> +{
> +	wilc->wiphy->features |= NL80211_FEATURE_SAE;

Even if I get the general need, it feels weird to have parts of the wphy init
performed in wilc_create_wiphy, and some parts (the features field) here.
Wouldn't it work to just move wilc_create_wiphy content here, since wphy will
not be usable anyway before eventually registering it ?

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ