batman-adv: 2015.0 bugfixes & stability updates
authorMarek Lindner <mareklindner@neomailbox.ch>
Sun, 28 Jun 2015 14:18:13 +0000 (22:18 +0800)
committerMarek Lindner <mareklindner@neomailbox.ch>
Sun, 28 Jun 2015 14:18:50 +0000 (22:18 +0800)
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
13 files changed:
batman-adv/patches/0001-batman-adv-Avoid-u32-overflow-during-gateway-select.patch
batman-adv/patches/0002-batman-adv-avoid-DAT-to-mess-up-LAN-state.patch
batman-adv/patches/0003-batman-adv-Make-DAT-capability-changes-atomic.patch
batman-adv/patches/0004-batman-adv-Make-NC-capability-changes-atomic.patch
batman-adv/patches/0005-batman-adv-Make-TT-capability-changes-atomic.patch
batman-adv/patches/0006-batman-adv-Make-MCAST-capability-changes-atomic.patch
batman-adv/patches/0007-batman-adv-Fix-potential-synchronization-issues-in-m.patch
batman-adv/patches/0008-batman-adv-Fix-compile-error-on-deactivated-MCAST-fe.patch
batman-adv/patches/0009-batman-adv-fix-kernel-crash-due-to-missing-NULL-chec.patch
batman-adv/patches/0010-batman-adv-protect-tt_local_entry-from-concurrent-de.patch
batman-adv/patches/0011-batman-adv-protect-tt-request-from-double-deletion.patch [new file with mode: 0644]
batman-adv/patches/0012-batman-adv-initialize-up-down-values-when-adding-a-g.patch [new file with mode: 0644]
batman-adv/patches/0013-batman-adv-remove-broadcast-packets-scheduled-for-pu.patch [new file with mode: 0644]

index 2955e75c95b1e33db972fbf283256c357be07274..19eb2fbac23e99197a3c3eb6145451b23c248f8d 100644 (file)
@@ -1,7 +1,7 @@
 From f63c54bba31d2c86269982fd8efdfb618f1daabe Mon Sep 17 00:00:00 2001
 From: Ruben Wisniewski <ruben@freifunk-nrw.de>
 Date: Tue, 26 May 2015 18:34:27 +0200
-Subject: [PATCH 01/10] batman-adv: Avoid u32 overflow during gateway select
+Subject: [PATCH 01/13] batman-adv: Avoid u32 overflow during gateway select
 
 The gateway selection based on fast connections is using a single value
 calculated from the average tq (0-255) and the download bandwidth (in
index bdc0d4a6bbff80af1b46f77362912bec7b574bb7..082c097ff69e7d7899ac1694e8686fbe90f3d8b6 100644 (file)
@@ -1,7 +1,7 @@
 From 9bbd794030657fe0d38590cd67d4801b989cebf9 Mon Sep 17 00:00:00 2001
 From: Antonio Quartulli <antonio@meshcoding.com>
 Date: Mon, 1 Jun 2015 17:29:57 +0200
-Subject: [PATCH 02/10] batman-adv: avoid DAT to mess up LAN state
+Subject: [PATCH 02/13] batman-adv: avoid DAT to mess up LAN state
 
 When a node running DAT receives an ARP request from the LAN for the
 first time, it is likely that this node will request the ARP entry
index aa8718a1c06bfd708f04a85ed80d94da2cb4a7ff..0f6ce8c135f3d1ed4293db12576688a5c2b0dcc5 100644 (file)
@@ -1,7 +1,7 @@
 From bfd0fbaef270ac4ed8e4457a38ef8d91190c0540 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
 Date: Tue, 16 Jun 2015 17:10:22 +0200
-Subject: [PATCH 03/10] batman-adv: Make DAT capability changes atomic
+Subject: [PATCH 03/13] batman-adv: Make DAT capability changes atomic
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
index 55996a9585893eef1d69c3b95dd42e01a639f879..e69178ee61b14da5715303199d73d94d0114fa8b 100644 (file)
@@ -1,7 +1,7 @@
 From 586df9e2537b51c0df7ce99576c3cee1681b64de Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
 Date: Tue, 16 Jun 2015 17:10:23 +0200
-Subject: [PATCH 04/10] batman-adv: Make NC capability changes atomic
+Subject: [PATCH 04/13] batman-adv: Make NC capability changes atomic
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
index 788cf3265921b896f98d8fe4dd9681fb48f22a74..f41b7753026e3766945861de2974e84de78ae64b 100644 (file)
@@ -1,7 +1,7 @@
 From a51fa16ecf3f079518baaa56bffae343bd5694f0 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
 Date: Tue, 16 Jun 2015 17:10:24 +0200
-Subject: [PATCH 05/10] batman-adv: Make TT capability changes atomic
+Subject: [PATCH 05/13] batman-adv: Make TT capability changes atomic
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
index 7876e284e3486e94fb7f3c27355139ccf4d05a88..99f90386d8b3d5e3317ac3e11b47db18abbfe380 100644 (file)
@@ -1,7 +1,7 @@
 From 201a54ba710ab7f40b82ad3c109f702c47d0761f Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
 Date: Tue, 16 Jun 2015 17:10:25 +0200
-Subject: [PATCH 06/10] batman-adv: Make MCAST capability changes atomic
+Subject: [PATCH 06/13] batman-adv: Make MCAST capability changes atomic
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
index 2688efd176bd23f3cb5cebd26842e0ea2a2f5018..2a2496e37c6a1f7a9cde878de10d222e09bf1d4e 100644 (file)
@@ -1,7 +1,7 @@
 From 7f220ed1f063be00833bd34a013c8f3f45884031 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
 Date: Tue, 16 Jun 2015 17:10:26 +0200
-Subject: [PATCH 07/10] batman-adv: Fix potential synchronization issues in
+Subject: [PATCH 07/13] batman-adv: Fix potential synchronization issues in
  mcast tvlv handler
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
index e0bfa7061d68502c6273bbaa3c76243e15d19b2b..eff82493120255562aa7318a638482bbce65ba8c 100644 (file)
@@ -1,7 +1,7 @@
 From 256776ef8562744f90ac9379364df4cf88291b49 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
 Date: Thu, 18 Jun 2015 06:47:19 +0200
-Subject: [PATCH 08/10] batman-adv: Fix compile error on deactivated MCAST
+Subject: [PATCH 08/13] batman-adv: Fix compile error on deactivated MCAST
  feature
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
index 0fc7f4e0c11bd014baf36907a5c985d96fa5d8ec..c217a93aed21f9eab0f6763ca0a41024bc541eb6 100644 (file)
@@ -1,7 +1,7 @@
 From 2c2dfd886a400057ccbc66f1507c94ed909d2a89 Mon Sep 17 00:00:00 2001
 From: Marek Lindner <mareklindner@neomailbox.ch>
 Date: Tue, 9 Jun 2015 21:24:36 +0800
-Subject: [PATCH 09/10] batman-adv: fix kernel crash due to missing NULL checks
+Subject: [PATCH 09/13] batman-adv: fix kernel crash due to missing NULL checks
 
 batadv_softif_vlan_get() may return NULL which has to be verified
 by the caller.
index ed905496d8e10ad28b875e7ddf7814d2ac9d3c60..7dc83a7f99c87af76ee61c6a09abe8c468195697 100644 (file)
@@ -1,7 +1,7 @@
 From af912d77181f252e6fdd324592d006e30bc82909 Mon Sep 17 00:00:00 2001
 From: Marek Lindner <mareklindner@neomailbox.ch>
 Date: Wed, 17 Jun 2015 20:01:36 +0800
-Subject: [PATCH 10/10] batman-adv: protect tt_local_entry from concurrent
+Subject: [PATCH 10/13] batman-adv: protect tt_local_entry from concurrent
  delete events
 
 The tt_local_entry deletion performed in batadv_tt_local_remove() was neither
diff --git a/batman-adv/patches/0011-batman-adv-protect-tt-request-from-double-deletion.patch b/batman-adv/patches/0011-batman-adv-protect-tt-request-from-double-deletion.patch
new file mode 100644 (file)
index 0000000..61da936
--- /dev/null
@@ -0,0 +1,58 @@
+From 9bac35c1e4fab662522371f81147963e19693409 Mon Sep 17 00:00:00 2001
+From: Marek Lindner <mareklindner@neomailbox.ch>
+Date: Mon, 22 Jun 2015 00:36:28 +0800
+Subject: [PATCH 11/13] batman-adv: protect tt request from double deletion
+
+The list_del() calls were changed to list_del_init() to prevent
+an accidental double deletion in batadv_tt_req_node_new().
+
+Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
+Acked-by: Antonio Quartulli <antonio@meshcoding.com>
+---
+ translation-table.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/translation-table.c b/translation-table.c
+index dfe8896..b6c0f52 100644
+--- a/translation-table.c
++++ b/translation-table.c
+@@ -2194,7 +2194,7 @@ static void batadv_tt_req_list_free(struct batadv_priv *bat_priv)
+       spin_lock_bh(&bat_priv->tt.req_list_lock);
+       list_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
+-              list_del(&node->list);
++              list_del_init(&node->list);
+               kfree(node);
+       }
+@@ -2230,7 +2230,7 @@ static void batadv_tt_req_purge(struct batadv_priv *bat_priv)
+       list_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
+               if (batadv_has_timed_out(node->issued_at,
+                                        BATADV_TT_REQUEST_TIMEOUT)) {
+-                      list_del(&node->list);
++                      list_del_init(&node->list);
+                       kfree(node);
+               }
+       }
+@@ -2512,7 +2512,8 @@ out:
+               batadv_hardif_free_ref(primary_if);
+       if (ret && tt_req_node) {
+               spin_lock_bh(&bat_priv->tt.req_list_lock);
+-              list_del(&tt_req_node->list);
++              /* list_del_init() verifies tt_req_node still is in the list */
++              list_del_init(&tt_req_node->list);
+               spin_unlock_bh(&bat_priv->tt.req_list_lock);
+               kfree(tt_req_node);
+       }
+@@ -2949,7 +2950,7 @@ static void batadv_handle_tt_response(struct batadv_priv *bat_priv,
+       list_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) {
+               if (!batadv_compare_eth(node->addr, resp_src))
+                       continue;
+-              list_del(&node->list);
++              list_del_init(&node->list);
+               kfree(node);
+       }
+-- 
+2.1.4
+
diff --git a/batman-adv/patches/0012-batman-adv-initialize-up-down-values-when-adding-a-g.patch b/batman-adv/patches/0012-batman-adv-initialize-up-down-values-when-adding-a-g.patch
new file mode 100644 (file)
index 0000000..6338edc
--- /dev/null
@@ -0,0 +1,42 @@
+From 3c92b633715b7eca80dc7a2347e0e4dbcce1f018 Mon Sep 17 00:00:00 2001
+From: Simon Wunderlich <simon@open-mesh.com>
+Date: Wed, 24 Jun 2015 14:50:19 +0200
+Subject: [PATCH 12/13] batman-adv: initialize up/down values when adding a
+ gateway
+
+Without this initialization, gateways which actually announce up/down
+bandwidth of 0/0 could be added. If these nodes get purged via
+_batadv_purge_orig() later, the gw_node structure does not get removed
+since batadv_gw_node_delete() updates the gw_node with up/down
+bandwidth of 0/0, and the updating function then discards the change
+and does not free gw_node.
+
+This results in leaking the gw_node structures, which references other
+structures: gw_node -> orig_node -> orig_node_ifinfo -> hardif. When
+removing the interface later, the open reference on the hardif may cause
+hangs with the infamous "unregister_netdevice: waiting for mesh1 to
+become free. Usage count = 1" message.
+
+Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
+Acked-by: Antonio Quartulli <antonio@meshcoding.com>
+Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
+---
+ gateway_client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gateway_client.c b/gateway_client.c
+index 3f32357..d8e3ead 100644
+--- a/gateway_client.c
++++ b/gateway_client.c
+@@ -419,6 +419,8 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv,
+       INIT_HLIST_NODE(&gw_node->list);
+       gw_node->orig_node = orig_node;
++      gw_node->bandwidth_down = ntohl(gateway->bandwidth_down);
++      gw_node->bandwidth_up = ntohl(gateway->bandwidth_up);
+       atomic_set(&gw_node->refcount, 1);
+       spin_lock_bh(&bat_priv->gw.list_lock);
+-- 
+2.1.4
+
diff --git a/batman-adv/patches/0013-batman-adv-remove-broadcast-packets-scheduled-for-pu.patch b/batman-adv/patches/0013-batman-adv-remove-broadcast-packets-scheduled-for-pu.patch
new file mode 100644 (file)
index 0000000..da455e1
--- /dev/null
@@ -0,0 +1,32 @@
+From 07bec2d4dec83f024baf166b95cf037be3a7eca5 Mon Sep 17 00:00:00 2001
+From: Simon Wunderlich <simon@open-mesh.com>
+Date: Wed, 24 Jun 2015 14:50:20 +0200
+Subject: [PATCH 13/13] batman-adv: remove broadcast packets scheduled for
+ purged outgoing if
+
+When an interface is purged, the broadcast packets scheduled for this
+interface should get purged as well.
+
+Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
+Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
+---
+ send.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/send.c b/send.c
+index 23635bd..a7e84b2 100644
+--- a/send.c
++++ b/send.c
+@@ -598,7 +598,8 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
+                * we delete only packets belonging to the given interface
+                */
+               if ((hard_iface) &&
+-                  (forw_packet->if_incoming != hard_iface))
++                  (forw_packet->if_incoming != hard_iface) &&
++                  (forw_packet->if_outgoing != hard_iface))
+                       continue;
+               spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
+-- 
+2.1.4
+