Skip to contentSkip to conversation

ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

PATCH In review Dongliang Mu 3 participants 6 messages Jul 5, 2021 – Jul 7, 2021

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

PATCH 1/1 ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF.

Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
---
 drivers/net/ieee802154/mac802154_hwsim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ieee802154/mac802154_hwsim.c +2 -2
index ebc976b7fcc2..cae52bfb871e 100644
@@ -528,14 +528,14 @@ static int hwsim_set_edge_lqi(struct sk_buff *msg, struct genl_info *info)
 	u32 v0, v1;
 	u8 lqi;
 
-	if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
+	if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
 	    !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
 		return -EINVAL;
 
 	if (nla_parse_nested_deprecated(edge_attrs, MAC802154_HWSIM_EDGE_ATTR_MAX, info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE], hwsim_edge_policy, NULL))
 		return -EINVAL;
 
-	if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] &&
+	if (!edge_attrs[MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID] ||
 	    !edge_attrs[MAC802154_HWSIM_EDGE_ATTR_LQI])
 		return -EINVAL;
 
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · Dongliang Mu

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF.

Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")

Thanks, but there are more places than this one. Can you send patches for them as well? Thanks! :)

- Alex

#2 lore raw
Quoted 9 lines · Alexander Aring

Hi,

Quoted 5 lines · Dongliang Mu

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF.

Quoted 7 lines
Quoted 2 lines
Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")

Thanks, but there are more places than this one. Can you send patches for them as well? Thanks! :)

Sure. I will double-check those places and send patches to fix them.

Quoted 2 lines

- Alex

maintainer
#3 lore raw

Hello.

Quoted 13 lines · Dongliang Mu
Quoted 12 lines · Alexander Aring

Hi,

Quoted 7 lines · Dongliang Mu

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF.

Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
Quoted 6 lines
Quoted 4 lines

Thanks, but there are more places than this one. Can you send patches for them as well? Thanks! :)

Sure. I will double-check those places and send patches to fix them.

I will take this one in as-is. All new patches should be done with this one applied.

regards
Stefan Schmidt

#4 lore raw
Quoted 19 lines · Stefan Schmidt

Hello.

Quoted 15 lines · Dongliang Mu
Quoted 14 lines · Alexander Aring

Hi,

Quoted 7 lines · Dongliang Mu

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF.

Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Thanks, but there are more places than this one. Can you send patches for them as well? Thanks! :)

Sure. I will double-check those places and send patches to fix them.

I will take this one in as-is. All new patches should be done with this one applied.

Sure. Thanks for your reminder.

Quoted 3 lines

regards
Stefan Schmidt

maintainer
#5 lore raw
In reply to Alexander Aring

Hello.

Quoted 4 lines · Alexander Aring

Hi,

Quoted 1 line · Dongliang Mu
Quoted 8 lines
Quoted 6 lines

Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE, MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID and MAC802154_HWSIM_EDGE_ATTR_LQI must be present to fix GPF.

Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")

This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks!

regards
Stefan Schmidt