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 <edumazet@google.com> Cc: Alexander Aring <alex.aring@gmail.com> Cc: Stefan Schmidt <stefan@datenfreihafen.org> Reported-by: syzbot <syzkaller@googlegroups.com> Acked-by: Alexander Aring <aahringo@redhat.com> Link: https://lore.kernel.org/r/20210621180244.882076-1-eric.dumazet@gmail.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
1 parent 28a5501 commit 0303b30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)