mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
batman-adv: mcast: ensure unshared skb for multicast packets
When a packet is transmitted via a batman-adv interface and has already
enough room for the header then nothing will make sure that the skbuff is
unshared. But it is not allowed to modify a currently shared skbuff.
Always make sure that the pskb_expand_head() is not only called for a too
small header but also for shared skbuffs.
Cc: stable@vger.kernel.org
Fixes: 9003913322 ("batman-adv: mcast: implement multicast packet generation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
parent
7aedb59b80
commit
82bf207f48
|
|
@ -1105,8 +1105,7 @@ static int batadv_mcast_forw_expand_head(struct batadv_priv *bat_priv,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (skb_headroom(skb) < hdr_size &&
|
||||
pskb_expand_head(skb, hdr_size, 0, GFP_ATOMIC) < 0)
|
||||
if (skb_cow(skb, hdr_size) < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user