mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
batman-adv: fix header size check in batadv_dbg_arp()
[ Upstream commit6f27d2c2a8
] 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:be1db4f661
("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: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
99ba9a9728
commit
6b4a3d4e63
1 changed files with 1 additions and 1 deletions
|
@ -391,7 +391,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;
|
||||
|
|
Loading…
Reference in a new issue