ieee802154: mac802154: handle the reserved dest mode by dropping the packet
authorMartin Townsend <martin.townsend@xsilon.com>
Tue, 19 Aug 2014 17:03:30 +0000 (19:03 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 19 Aug 2014 17:17:41 +0000 (19:17 +0200)
If received frame contains the reserved destination address mode. The
frame should be dropped and free the skb.

Signed-off-by: Martin Townsend <martin.townsend@xsilon.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/mac802154/wpan.c

index 4c133239ad39c34dbc15c855e8d830277eb2c7e7..547838822d5e9c0d7064d72e2dc3be1ff2c14e14 100644 (file)
@@ -462,7 +462,10 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
                        skb->pkt_type = PACKET_OTHERHOST;
                break;
        default:
-               break;
+               spin_unlock_bh(&sdata->mib_lock);
+               pr_debug("invalid dest mode\n");
+               kfree_skb(skb);
+               return NET_RX_DROP;
        }
 
        spin_unlock_bh(&sdata->mib_lock);