Skip to content

Commit 0303b30

Browse files
edumazetStefan-Schmidt
authored andcommitted
ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()
Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE must be present to avoid a crash. Fixes: f25da51 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Eric Dumazet <[email protected]> Cc: Alexander Aring <[email protected]> Cc: Stefan Schmidt <[email protected]> Reported-by: syzbot <[email protected]> Acked-by: Alexander Aring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 28a5501 commit 0303b30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ieee802154/mac802154_hwsim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int hwsim_del_edge_nl(struct sk_buff *msg, struct genl_info *info)
480480
struct hwsim_edge *e;
481481
u32 v0, v1;
482482

483-
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
483+
if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] ||
484484
!info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
485485
return -EINVAL;
486486

0 commit comments

Comments
 (0)