[PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

Subsystems: ieee 802.15.4 subsystem, networking drivers, the rest

STALE1875d LANDED

Landed in mainline as e9faf53c5a5d on 2021-07-07.

6 messages, 3 authors, 2021-07-07 · open the first message on its own page

[PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

From: Dongliang Mu <hidden>
Date: 2021-07-05 13:13:54

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")
Signed-off-by: Dongliang Mu <redacted>
---
 drivers/net/ieee802154/mac802154_hwsim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index ebc976b7fcc2..cae52bfb871e 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -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;
 
-- 
2.25.1

Re: [PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

From: Alexander Aring <alex.aring@gmail.com>
Date: 2021-07-07 13:44:41

Hi,

On Mon, 5 Jul 2021 at 09:13, Dongliang Mu [off-list ref] wrote:
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")
Signed-off-by: Dongliang Mu <redacted>
Acked-by: Alexander Aring <aahringo@redhat.com>

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

- Alex

Re: [PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

From: Dongliang Mu <hidden>
Date: 2021-07-07 14:40:45

On Wed, Jul 7, 2021 at 9:44 PM Alexander Aring [off-list ref] wrote:
Hi,

On Mon, 5 Jul 2021 at 09:13, Dongliang Mu [off-list ref] wrote:
quoted
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")
Signed-off-by: Dongliang Mu <redacted>
Acked-by: Alexander Aring <aahringo@redhat.com>

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.
- Alex

Re: [PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: 2021-07-07 14:42:01

Hello.

On 07.07.21 16:40, Dongliang Mu wrote:
On Wed, Jul 7, 2021 at 9:44 PM Alexander Aring [off-list ref] wrote:
quoted
Hi,

On Mon, 5 Jul 2021 at 09:13, Dongliang Mu [off-list ref] wrote:
quoted
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")
Signed-off-by: Dongliang Mu <redacted>
Acked-by: Alexander Aring <aahringo@redhat.com>

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

Re: [PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

From: Dongliang Mu <hidden>
Date: 2021-07-07 14:43:32

On Wed, Jul 7, 2021 at 10:41 PM Stefan Schmidt
[off-list ref] wrote:
Hello.

On 07.07.21 16:40, Dongliang Mu wrote:
quoted
On Wed, Jul 7, 2021 at 9:44 PM Alexander Aring [off-list ref] wrote:
quoted
Hi,

On Mon, 5 Jul 2021 at 09:13, Dongliang Mu [off-list ref] wrote:
quoted
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")
Signed-off-by: Dongliang Mu <redacted>
Acked-by: Alexander Aring <aahringo@redhat.com>

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.
regards
Stefan Schmidt

Re: [PATCH] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi

From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: 2021-07-07 14:51:00

Hello.

On 07.07.21 15:44, Alexander Aring wrote:
Hi,

On Mon, 5 Jul 2021 at 09:13, Dongliang Mu [off-list ref] wrote:
quoted
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")
Signed-off-by: Dongliang Mu <redacted>
Acked-by: Alexander Aring <aahringo@redhat.com>

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

regards
Stefan Schmidt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help