]> Git Repo - linux.git/commitdiff
ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()
authorEric Dumazet <[email protected]>
Mon, 21 Jun 2021 18:02:44 +0000 (11:02 -0700)
committerStefan Schmidt <[email protected]>
Tue, 22 Jun 2021 19:26:59 +0000 (21:26 +0200)
Both MAC802154_HWSIM_ATTR_RADIO_ID and MAC802154_HWSIM_ATTR_RADIO_EDGE
must be present to avoid a crash.

Fixes: f25da51fdc38 ("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]>
drivers/net/ieee802154/mac802154_hwsim.c

index baa7e21b7f4f99e08fc2c9d376a4910c47034786..ebc976b7fcc2adcd7cb27589e0981a21bde4241c 100644 (file)
@@ -480,7 +480,7 @@ static int hwsim_del_edge_nl(struct sk_buff *msg, struct genl_info *info)
        struct hwsim_edge *e;
        u32 v0, v1;
 
-       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;
 
This page took 0.062018 seconds and 4 git commands to generate.