mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
batman-adv: gw: acquire ethernet header only after skb realloc
commit77880a3be8upstream. The pskb_may_pull() called by batadv_get_vid() could reallocate the buffer behind the skb. Variables which were pointing to the old buffer need to be reassigned to avoid an use-after-free. Cc: stable@vger.kernel.org Fixes:6c413b1c22("batman-adv: send every DHCP packet as bat-unicast") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
27206bb57c
commit
afac8096bd
@@ -693,12 +693,13 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
|
||||
struct batadv_gw_node *gw_node = NULL;
|
||||
struct batadv_gw_node *curr_gw = NULL;
|
||||
struct batadv_neigh_ifinfo *curr_ifinfo, *old_ifinfo;
|
||||
struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
|
||||
struct ethhdr *ethhdr;
|
||||
bool out_of_range = false;
|
||||
u8 curr_tq_avg;
|
||||
unsigned short vid;
|
||||
|
||||
vid = batadv_get_vid(skb, 0);
|
||||
ethhdr = (struct ethhdr *)skb->data;
|
||||
|
||||
if (is_multicast_ether_addr(ethhdr->h_dest))
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user