* [PATCH net 1/1] batman-adv: avoid OGM aggregation when skb tailroom is insufficient
[not found] <20260317160002.1869478-1-sw@simonwunderlich.de>
@ 2026-03-17 16:00 ` Simon Wunderlich
2026-03-19 0:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Simon Wunderlich @ 2026-03-17 16:00 UTC (permalink / raw)
To: davem, kuba
Cc: netdev, b.a.t.m.a.n, Yang Yang, stable, Yifan Wu, Juefei Pu,
Yuan Tan, Xin Liu, Sven Eckelmann, Simon Wunderlich
From: Yang Yang <n05ec@lzu.edu.cn>
When OGM aggregation state is toggled at runtime, an existing forwarded
packet may have been allocated with only packet_len bytes, while a later
packet can still be selected for aggregation. Appending in this case can
hit skb_put overflow conditions.
Reject aggregation when the target skb tailroom cannot accommodate the new
packet. The caller then falls back to creating a new forward packet
instead of appending.
Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
Cc: stable@vger.kernel.org
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Signed-off-by: Yuan Tan <tanyuan98@outlook.com>
Signed-off-by: Xin Liu <bird@lzu.edu.cn>
Signed-off-by: Ao Zhou <n05ec@lzu.edu.cn>
Signed-off-by: Yang Yang <n05ec@lzu.edu.cn>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
net/batman-adv/bat_iv_ogm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index b75c2228e69a6..f28e9cbf8ad5f 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -473,6 +473,9 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet,
if (aggregated_bytes > max_bytes)
return false;
+ if (skb_tailroom(forw_packet->skb) < packet_len)
+ return false;
+
if (packet_num >= BATADV_MAX_AGGREGATION_PACKETS)
return false;
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net 1/1] batman-adv: avoid OGM aggregation when skb tailroom is insufficient
2026-03-17 16:00 ` [PATCH net 1/1] batman-adv: avoid OGM aggregation when skb tailroom is insufficient Simon Wunderlich
@ 2026-03-19 0:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-19 0:50 UTC (permalink / raw)
To: Simon Wunderlich
Cc: davem, kuba, netdev, b.a.t.m.a.n, n05ec, stable, yifanwucs,
tomapufckgml, tanyuan98, bird, sven
Hello:
This patch was applied to netdev/net.git (main)
by Simon Wunderlich <sw@simonwunderlich.de>:
On Tue, 17 Mar 2026 17:00:02 +0100 you wrote:
> From: Yang Yang <n05ec@lzu.edu.cn>
>
> When OGM aggregation state is toggled at runtime, an existing forwarded
> packet may have been allocated with only packet_len bytes, while a later
> packet can still be selected for aggregation. Appending in this case can
> hit skb_put overflow conditions.
>
> [...]
Here is the summary with links:
- [net,1/1] batman-adv: avoid OGM aggregation when skb tailroom is insufficient
https://git.kernel.org/netdev/net/c/0d4aef630be9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-19 0:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260317160002.1869478-1-sw@simonwunderlich.de>
2026-03-17 16:00 ` [PATCH net 1/1] batman-adv: avoid OGM aggregation when skb tailroom is insufficient Simon Wunderlich
2026-03-19 0:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox