diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-03-16 11:29:10 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-06-16 22:22:42 +0100 |
commit | 6be944c7ddec99cc9e52e4cdde3123e2db7fa156 (patch) | |
tree | f7602e4352a531c3235b66c73d592af3dd11efe2 | |
parent | 2cb0c19c38fa7595ea3afb7ec9ea65ce51a45c13 (diff) | |
download | linux-rt-6be944c7ddec99cc9e52e4cdde3123e2db7fa156.tar.gz |
batman-adv: fix header size check in batadv_dbg_arp()
commit 6f27d2c2a8c236d296201c19abb8533ec20d212b upstream.
Checking for 0 is insufficient: when an SKB without a batadv header, but
with a VLAN header is received, hdr_size will be 4, making the following
code interpret the Ethernet header as a batadv header.
Fixes: be1db4f6615b ("batman-adv: make the Distributed ARP Table vlan aware")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | net/batman-adv/distributed-arp-table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 7353487b787f..ab83d8b16c45 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -343,7 +343,7 @@ static void batadv_dbg_arp(struct batadv_priv *bat_priv, struct sk_buff *skb, batadv_arp_hw_src(skb, hdr_size), &ip_src, batadv_arp_hw_dst(skb, hdr_size), &ip_dst); - if (hdr_size == 0) + if (hdr_size < sizeof(struct batadv_unicast_packet)) return; unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; |