mirror of
https://github.com/openwrt/routing.git
synced 2026-04-15 10:51:56 +00:00
* avoid OGM aggregation when skb tailroom is insufficient * reject oversized global TT response buffers * hold claim backbone gateways by reference Signed-off-by: Sven Eckelmann <sven@narfation.org>
36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
From: Yang Yang <n05ec@lzu.edu.cn>
|
|
Date: Sat, 14 Mar 2026 07:11:27 +0000
|
|
Subject: batman-adv: avoid OGM aggregation when skb tailroom is insufficient
|
|
|
|
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: 9f0c9aeb4de6 ("batman-adv: fix crash when new OGM is generated")
|
|
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>
|
|
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/?id=e86d615a4364151e08e351ab2c4b1d1f77c00361
|
|
|
|
--- 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
|
|
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;
|
|
|