]> git.hungrycats.org Git - linux/commit
batman-adv: ensure bcast is writable before modifying TTL
authorSven Eckelmann <sven@narfation.org>
Wed, 10 Jun 2026 11:33:19 +0000 (13:33 +0200)
committerSven Eckelmann <sven@narfation.org>
Sat, 13 Jun 2026 05:51:17 +0000 (07:51 +0200)
commit4cd6d3a4b96a8576f1fed8f9f9f17c2dc2978e0c
tree4f57d012c14c9ba1d93e774069804130c2e6af45
parentdf97a7107b16375a10a36d7a63e9b4291a8ac680
batman-adv: ensure bcast is writable before modifying TTL

Before batman-adv is allowed to write to an skb, it either has to have its
own copy of the skb or used skb_cow() to ensure that the data part is not
shared.

The old implementation used a shared queue and created copies before
attempting to write to it. But with the new implementation, the broadcast
packet is already modified when it gets received. Potentially writing to
shared buffers in this process.

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

Cc: stable@kernel.org
Fixes: 3f69339068f9 ("batman-adv: bcast: queue per interface, if needed")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/routing.c