wifi: brcmfmac: do not cast hidden SSID attribute value to boolean
PATCH 1/1 wifi: brcmfmac: do not cast hidden SSID attribute value to boolean
In 'brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USE is zero but prefer
an explicit check instead. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +1 -1
@@ -5272,7 +5272,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, settings->hidden_ssid);if (err) {bphy_err (drvr,"%s closednet error (%d)\n" , - settings->hidden_ssid ? + (settings->hidden_ssid !=NL80211_HIDDEN_SSID_NOT_IN_USE ) ?"enabled" :"disabled" , err); goto exit;
Signature · 1 line
2.39.3
Arend van Spriel
maintainerQuoted 5 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Thanks, Alexey
Makes sense, but ....
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, · line 5272
Quoted 11 lines
Signed-off-by Alexey Berezhok <[email protected]>--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +0
-0@@ -5272,7 +5272,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, settings->hidden_ssid);
settings->hidden_ssid has already been used above in following call:
err = brcmf_fil_iovar_int_set(ifp, "closednet", settings->hidden_ssid);
So we pass the value as is to firmware using the same assumption, ie. NL80211_HIDDEN_SSID_NOT_IN_USE. Is this not ABI thus very unlikely to change?
@Johannes:
Actually not quite understanding the reason for having this setting in nl80211. hidden_ssid means SSID element length is zero, right?
Regards,
Arend
Quoted 7 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +1
-1if (err) {bphy_err (drvr,"%s closednet error (%d)\n" , - settings->hidden_ssid ? + (settings->hidden_ssid !=NL80211_HIDDEN_SSID_NOT_IN_USE ) ?"enabled" :"disabled" , err); goto exit;
Quoted 9 lines · Arend van Spriel
settings->hidden_ssidhas already been used above in following call:err = brcmf_fil_iovar_int_set(ifp, "closednet", settings->hidden_ssid);So we pass the value as is to firmware using the same assumption, ie.
NL80211_HIDDEN_SSID_NOT_IN_USE. Is this not ABI thus very unlikely to change?
The ABI won't change, that'd break all the users of nl80211 that use this :-)
Quoted 4 lines
@Johannes:
Actually not quite understanding the reason for having this setting in nl80211.hidden_ssidmeans SSID element length is zero, right?
Well, there at least _were_ APs doing the correct SSID length but setting all octets to zero ... Not sure that's still a thing though.
johannes
Arend Van Spriel
maintainerQuoted 7 lines · Johannes Berg
Quoted 6 lines · Arend van Spriel
settings->hidden_ssidhas already been used above in following call:err = brcmf_fil_iovar_int_set(ifp, "closednet",
settings->hidden_ssid);
Quoted 6 lines
Quoted 3 lines
So we pass the value as is to firmware using the same assumption, ie.
NL80211_HIDDEN_SSID_NOT_IN_USE. Is this not ABI thus very unlikely to change?The ABI won't change, that'd break all the users of nl80211 that use this :-)
Right. So basically the assumption that NL80211_HIDDEN_SSID_NOT_IN_USE is and will be zero is a safe one.
Quoted 7 lines
Quoted 4 lines
@Johannes:
Actually not quite understanding the reason for having this setting in nl80211.hidden_ssidmeans SSID element length is zero, right?Well, there at least _were_ APs doing the correct SSID length but setting all octets to zero ... Not sure that's still a thing though.
I now looked at the definition and see indeed two distinct flavours of "hidden SSID". Interesting although I have never considered it a useful feature.
Regards,
Arend
Quoted 7 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>
Patch applied to wireless-next.git, thanks.
f20073f50dfd wifi: brcmfmac: do not cast hidden SSID attribute value to boolean
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Arend van Spriel
maintainerQuoted 6 lines · Kalle Valo
Quoted 4 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.
Quoted 7 lines
Quoted 3 lines
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>Patch applied to wireless-next.git, thanks.
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to boolean
Alexey,
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Regards,
Arend
--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
Quoted 10 lines · Arend van Spriel
Quoted 9 lines · Kalle Valo
Quoted 7 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>
Quoted 8 lines
Quoted 3 lines
Patch applied to wireless-next.git, thanks.
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to booleanAlexey,
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Sorry, was I not supposed to apply the patch? What did I miss?
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Arend Van Spriel
maintainerQuoted 16 lines · Kalle Valo
Quoted 14 lines · Arend van Spriel
Quoted 12 lines · Kalle Valo
Quoted 7 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>Patch applied to wireless-next.git, thanks.
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to boolean
Quoted 6 lines
Quoted 4 lines
Alexey,
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Sorry, was I not supposed to apply the patch? What did I miss?
Nothing serious. settings->hidden_ssid value is used as-is to configure firmware. I wanted Alexey to address that in a v2.
Regards,
Arend
Quoted 20 lines · Arend Van Spriel
Quoted 18 lines · Kalle Valo
Quoted 16 lines · Arend van Spriel
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Quoted 6 lines
Quoted 3 lines
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>Patch applied to wireless-next.git, thanks.
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to booleanAlexey,
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Sorry, was I not supposed to apply the patch? What did I miss?
Nothing serious.
settings->hidden_ssidvalue is used as-is to configure firmware. I wanted Alexey to address that in a v2.
My bad, I misunderstood your intentions. Luckily this time it wasn't serious.
BTW to make super clear to me I would prefer that you (Arend) use Acked-by. It shows up in my script like the number '1' here:
*[ 4] [next] wifi: carl9170: Remove redundant assignment t... 1 - - 2 5d Colin Ian Ki Under Review
So if I don't see your Acked-by then I will not even look at the patch :)
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Arend van Spriel
maintainerQuoted 33 lines · Kalle Valo
Quoted 20 lines · Arend Van Spriel
Quoted 18 lines · Kalle Valo
Quoted 16 lines · Arend van Spriel
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Quoted 6 lines
Quoted 3 lines
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>Patch applied to wireless-next.git, thanks.
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to booleanAlexey,
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Sorry, was I not supposed to apply the patch? What did I miss?
Nothing serious.
settings->hidden_ssidvalue is used as-is to configure firmware. I wanted Alexey to address that in a v2.My bad, I misunderstood your intentions. Luckily this time it wasn't serious.
Quoted 6 lines
BTW to make super clear to me I would prefer that you (Arend) use Acked-by. It shows up in my script like the number '1' here:
*[ 4] [next] wifi: carl9170: Remove redundant assignment t... 1 - - 2 5d Colin Ian Ki Under Review
So if I don't see your Acked-by then I will not even look at the patch :)
Sure. I tend to use Acked-by if things look sane a quick glance. If I need to dig further I prefer to use Reviewed-by. If I have comments to revise the patch I will refrain using them. Is that ok or you really want it to be Acked-by?
Regards,
Arend
Quoted 9 lines · Arend van Spriel
Quoted 8 lines
My bad, I misunderstood your intentions. Luckily this time it wasn't serious.
BTW to make super clear to me I would prefer that you (Arend) use Acked-by. It shows up in my script like the number '1' here:
*[ 4] [next] wifi: carl9170: Remove redundant assignment t... 1 - -
2 5d Colin Ian Ki Under Review
So if I don't see your Acked-by then I will not even look at the patch :)
Quoted 4 lines
Sure. I tend to use Acked-by if things look sane a quick glance. If I need to dig further I prefer to use Reviewed-by. If I have comments to revise the patch I will refrain using them. Is that ok or you really want it to be Acked-by?
Ah, now I understand better. My understanding is that the maintainer of the driver uses Acked-by and others use Reviewed-by. This says the same:
https://docs.kernel.org/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by
And yes, I would prefer if you could use Acked-by always. It's up to your judgement if you do just a peek or in-depth review :)
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Arend Van Spriel
maintainerQuoted 16 lines · Kalle Valo
Quoted 9 lines · Arend van Spriel
Quoted 8 lines
My bad, I misunderstood your intentions. Luckily this time it wasn't serious.
BTW to make super clear to me I would prefer that you (Arend) use Acked-by. It shows up in my script like the number '1' here:
*[ 4] [next] wifi: carl9170: Remove redundant assignment t... 1 - -
2 5d Colin Ian Ki Under Review
So if I don't see your Acked-by then I will not even look at the patch :)Quoted 4 lines
Sure. I tend to use Acked-by if things look sane a quick glance. If I need to dig further I prefer to use Reviewed-by. If I have comments to revise the patch I will refrain using them. Is that ok or you really want it to be Acked-by?
Quoted 7 lines
Ah, now I understand better. My understanding is that the maintainer of the driver uses Acked-by and others use Reviewed-by. This says the same:
https://docs.kernel.org/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by
And yes, I would prefer if you could use Acked-by always. It's up to your judgement if you do just a peek or in-depth review :)
No problem. I think I can do that.
Regards,
Arend
Quoted 13 lines · Arend van Spriel
Quoted 12 lines · Kalle Valo
Quoted 7 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>Patch applied to wireless-next.git, thanks.
Quoted 10 lines
Quoted 1 line
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to booleanAlexey,
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Regards,
ArendSignature · 1 line
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
Hello, do you mean this kind of modification:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +1 -1
@@ -5269,7 +5269,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, } err =brcmf_fil_iovar_int_set (ifp,"closednet" , - settings->hidden_ssid); + (settings->hidden_ssid ==NL80211_HIDDEN_SSID_NOT_IN_USE ?0 :1 ));if (err) { bphy_err(drvr, "%s closednet error (%d)\n", (settings->hidden_ssid !=
NL80211_HIDDEN_SSID_NOT_IN_USE) ?
If so, I will make additional patch.
Regards,
Alexey
Arend Van Spriel
maintainerQuoted 44 lines · Alexey Berezhok
Quoted 18 lines · Arend van Spriel
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Alexey Berezhok
In '
brcmf_cfg80211_start_ap()', not assume thatNL80211_HIDDEN_SSID_NOT_IN_USEis zero but prefer
an explicit check instead. Compile tested only.Quoted 8 lines
Quoted 3 lines
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexey Berezhok <[email protected]>Patch applied to wireless-next.git, thanks.
f20073f50dfdwifi: brcmfmac: do not cast hidden SSID attribute value to booleanAlexey,
Quoted 7 lines
Can you do a follow-up patch addressing my comment? If not I will do it myself.
Regards,
Arend
--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/Hello, do you mean this kind of modification:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +1
-1@@ -5269,7 +5269,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy,struct net_device *ndev, } err =brcmf_fil_iovar_int_set (ifp,"closednet" , - settings->hidden_ssid); + (settings->hidden_ssid ==NL80211_HIDDEN_SSID_NOT_IN_USE ?0 :1 ));if (err) {bphy_err(drvr, "%s closednet error (%d)\n", (settings->hidden_ssid !=
Quoted 3 lines
NL80211_HIDDEN_SSID_NOT_IN_USE) ?If so, I will make additional patch.
That was indeed what I meant. Consider using local variable 'closednet' to pass in function call and use for error message.
Regards,
Arend
Quoted 2 lines
Regards,
Alexey
Thu, Feb 08, 2024 at 11:51:21AM +0300, Alexey Berezhok kirjoitti:
...
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, · line 5276
Quoted 3 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +1
-1- settings->hidden_ssid ? + (settings->hidden_ssid !=NL80211_HIDDEN_SSID_NOT_IN_USE ) ? "enabled" : "disabled",
Can somebody switch this to use str_enabled_disabled() from string_choices.h? Ideally, add str_disabled_enabled() in that header (as macro with negation on its argument) and use here as
str_disabled_enabled(settings->hidden_ssid == NL80211_HIDDEN_SSID_NOT_IN_USE)
Signature · 2 lines
With Best Regards, Andy Shevchenko