Skip to contentSkip to conversation

nl80211 wlcore regression in next

DISCUSSION Tony Lindgren 4 participants 10 messages Jun 25, 2019 – Jul 23, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

It fails with the warning below, any ideas what goes wrong?

Regards,

Tony

8< ----------------

WARNING: CPU: 0 PID: 21 at net/wireless/core.c:868 wiphy_register+0x85c/0xbd4 [cfg80211]

...
[<bf05f570>] (wiphy_register [cfg80211]) from [<bf121e08>] (ieee80211_register_hw+0x4e4/0xcd8 [mac80211]) [<bf121e08>] (ieee80211_register_hw [mac80211]) from [<bf33135c>] (wlcore_nvs_cb+0x758/0xabc [wlcore]) [<bf33135c>] (wlcore_nvs_cb [wlcore]) from [<c05c3770>] (request_firmware_work_func+0x50/0x8c) [<c05c3770>] (request_firmware_work_func) from [<c0154bb8>] (process_one_work+0x20c/0x504)
...

maintainer
#1 lore raw
Quoted 8 lines · Tony Lindgren

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

It fails with the warning below, any ideas what goes wrong?

Oops. For some reason, I neglected to check the vendor command usage beyond hwsim.

The patch below should work?

johannes

drivers/net/wireless/ath/wil6210/cfg80211.c +4 -0
index 804955d24b30..37ac95940c22 100644
@@ -177,6 +177,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
 		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SECTOR_CFG,
 		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
+		.policy = wil_rf_sector_policy,
 		.doit = wil_rf_sector_get_cfg
 	},
 	{
@@ -184,6 +185,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
 		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SECTOR_CFG,
 		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
+		.policy = wil_rf_sector_policy,
 		.doit = wil_rf_sector_set_cfg
 	},
 	{
@@ -192,6 +194,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
 			QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SELECTED_SECTOR,
 		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
+		.policy = wil_rf_sector_policy,
 		.doit = wil_rf_sector_get_selected
 	},
 	{
@@ -200,6 +203,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
 			QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SELECTED_SECTOR,
 		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
+		.policy = wil_rf_sector_policy,
 		.doit = wil_rf_sector_set_selected
 	},
 };
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c +1 -0
index d493021f6031..30ebadc5e5bb 100644
@@ -123,6 +123,7 @@ const struct wiphy_vendor_command brcmf_vendor_cmds[] = {
 		},
 		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
 			 WIPHY_VENDOR_CMD_NEED_NETDEV,
+		.policy = VENDOR_CMD_RAW_DATA,
 		.doit = brcmf_cfg80211_vndr_cmds_dcmd_handler
 	},
 };
drivers/net/wireless/ti/wlcore/vendor_cmd.c +3 -0
index 75756fb8e7b0..cd82d3580e87 100644
@@ -166,6 +166,7 @@ static const struct wiphy_vendor_command wlcore_vendor_commands[] = {
 		.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
 		.doit = wlcore_vendor_cmd_smart_config_start,
+		.policy = wlcore_vendor_attr_policy,
 	},
 	{
 		.info = {
@@ -175,6 +176,7 @@ static const struct wiphy_vendor_command wlcore_vendor_commands[] = {
 		.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
 		.doit = wlcore_vendor_cmd_smart_config_stop,
+		.policy = wlcore_vendor_attr_policy,
 	},
 	{
 		.info = {
@@ -184,6 +186,7 @@ static const struct wiphy_vendor_command wlcore_vendor_commands[] = {
 		.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
 			 WIPHY_VENDOR_CMD_NEED_RUNNING,
 		.doit = wlcore_vendor_cmd_smart_config_set_group_key,
+		.policy = wlcore_vendor_attr_policy,
 	},
 };
 
author Tested-by
#2 lore raw

Hi,

Quoted 8 lines · Johannes Berg
Quoted 7 lines · Tony Lindgren

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

Quoted 6 lines
Quoted 1 line

It fails with the warning below, any ideas what goes wrong?

Oops. For some reason, I neglected to check the vendor command usage beyond hwsim.

The patch below should work?

Yeah thanks that fixes the issue for me:

maintainer
#3 lore raw
Quoted 13 lines · Tony Lindgren

Hi,

Quoted 10 lines · Johannes Berg
Quoted 8 lines · Tony Lindgren

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

It fails with the warning below, any ideas what goes wrong?

Quoted 8 lines
Quoted 4 lines

Oops. For some reason, I neglected to check the vendor command usage beyond hwsim.

The patch below should work?

Yeah thanks that fixes the issue for me:

Thanks, I'll drop that into my tree and hopefully will remember to send it on soon.

johannes

maintainer
#4 lore raw
Quoted 17 lines · Johannes Berg
Quoted 16 lines · Tony Lindgren

Hi,

Quoted 13 lines · Johannes Berg
Quoted 8 lines · Tony Lindgren

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

It fails with the warning below, any ideas what goes wrong?

Oops. For some reason, I neglected to check the vendor command usage beyond hwsim.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

The patch below should work?

Yeah thanks that fixes the issue for me:

Thanks, I'll drop that into my tree and hopefully will remember to send it on soon.

Hi Johannes,

By chance noticed the patch included brcmfmac. So I tried, but I get compile issue below. It is because ERR_PTR really is an inline function so that is not working. So also need to patch that. I left the extra braces around the error code although not strictly necessary.

Regards,
Arend
---

include/net/cfg80211.h +1 -1
index 2d17e32..da8249b 100644
@@ -4172,7 +4172,7 @@ struct sta_opmode_info {
        u8 rx_nss;
 };
 
-#define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)ERR_PTR(-ENODATA))
+#define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)(-ENODATA))
 
 /**
  * struct wiphy_vendor_command - vendor command definition

---8<--------------------------------------------------------------------
CC [M] drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.o
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c:18:0:
./include/net/cfg80211.h:4175:29: error: initializer element is not constant

 #define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)ERR_PTR(-ENODATA))
                             ^
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c:126:13: note: in expansion of macro \u2018VENDOR_CMD_RAW_DATA\u2019
   .policy = VENDOR_CMD_RAW_DATA,
             ^
./include/net/cfg80211.h:4175:29: note: (near initialization for \u2018brcmf_vendor_cmds[0].policy\u2019)
 #define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)ERR_PTR(-ENODATA))
                             ^
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c:126:13: note: in expansion of macro \u2018VENDOR_CMD_RAW_DATA\u2019
   .policy = VENDOR_CMD_RAW_DATA,
             ^

make[3]: *** [drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.o] Error 1

maintainer
#5 lore raw

Hi Arend,

Quoted 4 lines

By chance noticed the patch included brcmfmac. So I tried, but I get compile issue below. It is because ERR_PTR really is an inline function so that is not working. So also need to patch that. I left the extra braces around the error code although not strictly necessary.

D'oh. I'll check that out, thanks for the report/patch!

johannes

Acked-by
#9 lore raw
In reply to Tony Lindgren
Quoted 13 lines · Tony Lindgren

Hi,

Quoted 10 lines · Johannes Berg
Quoted 8 lines · Tony Lindgren

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

It fails with the warning below, any ideas what goes wrong?

Quoted 8 lines
Quoted 4 lines

Oops. For some reason, I neglected to check the vendor command usage beyond hwsim.

The patch below should work?

Yeah thanks that fixes the issue for me:

Signature · 1 line
Kalle Valo
#6 lore raw
In reply to Johannes Berg

Hi,

Quoted 17 lines · Johannes Berg
Quoted 16 lines · Tony Lindgren

Hi,

Quoted 13 lines · Johannes Berg
Quoted 8 lines · Tony Lindgren

Hi,

Looks like at least drivers/net/wireless/ti wlcore driver has stopped working in Linux next with commit 901bb9891855 ("nl80211: require and validate vendor command policy"). Reverting the commit above makes it work again.

It fails with the warning below, any ideas what goes wrong?

Oops. For some reason, I neglected to check the vendor command usage beyond hwsim.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

The patch below should work?

Yeah thanks that fixes the issue for me:

Thanks, I'll drop that into my tree and hopefully will remember to send it on soon.

Looks like this one crept back as the fix is missing from v5.3-rc1.

Forgot to include in the pull request?

Regards,

Tony

maintainer
#7 lore raw

Hi,

Quoted 3 lines

Looks like this one crept back as the fix is missing from v5.3-rc1.

Forgot to include in the pull request?

More like forgot to send the pull request, my bad. I eventually realized a couple of days ago and it'll be coming upstream soon. Sorry about that.

johannes

#8 lore raw
Quoted 9 lines · Johannes Berg

Hi,

Quoted 3 lines

Looks like this one crept back as the fix is missing from v5.3-rc1.

Forgot to include in the pull request?

More like forgot to send the pull request, my bad. I eventually realized a couple of days ago and it'll be coming upstream soon. Sorry about that.

OK thanks,

Tony