batman-adv: frag: ensure fragment is writable before modifying TTL

commit b7293c6e8c upstream.

Before batman-adv is allowed to write to an skb, it either has to have its
own copy of the skb or use skb_cow() to ensure that the data part is not
shared. But batadv_frag_skb_fwd() modifies the TTL even when it is shared.

Adding a skb_cow() right before this operation avoids this and can at the
same time prepare it for the modifications required to forward the
fragment.

Cc: stable@kernel.org
Fixes: 610bfc6bc9 ("batman-adv: Receive fragmented packets and merge")
[ Context ]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Sven Eckelmann 2026-06-26 18:10:53 +02:00 • committed by Greg Kroah-Hartman
commit 595e6bcf36
3 changed files with 17 additions and 4 deletions