[B.A.T.M.A.N.] pull request: batman-adv 2011-03-05

2011-03-05 Thread Sven Eckelmann
Hi, I was asked to submit following pull request for net-next-2.6/linux-2.6.39. It contains Marek's hard work (and of course related work by other people) to remove the orig_hash (aka the batman-adv private big kernel lock). There are also smaller cleanups by Marek, Jesper Juhl and Linus

[B.A.T.M.A.N.] [PATCH 01/28] batman-adv: Remove two duplicate includes.

2011-03-05 Thread Sven Eckelmann
From: Jesper Juhl j...@chaosbits.net Remove duplicate inclusion of send.h and routing.h from net/batman-adv/soft-interface.c Signed-off-by: Jesper Juhl j...@chaosbits.net Signed-off-by: Sven Eckelmann s...@narfation.org Signed-off-by: Marek Lindner lindner_ma...@yahoo.de ---

[B.A.T.M.A.N.] [PATCH 02/28] batman-adv: protect neighbor nodes with reference counters

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/originator.c | 20 +++- net/batman-adv/originator.h |8 +--- net/batman-adv/routing.c|7 +++ net/batman-adv/types.h |1 + 4 files

[B.A.T.M.A.N.] [PATCH 03/28] batman-adv: convert neighbor list to hlist

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/originator.c | 30 +++--- net/batman-adv/routing.c| 29 ++--- net/batman-adv/types.h |4 ++-- 3 files changed, 35

[B.A.T.M.A.N.] [PATCH 04/28] batman-adv: protect neighbor list with rcu locks

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/originator.c | 35 --- net/batman-adv/routing.c| 41 +++-- net/batman-adv/types.h |2 ++ 3 files

[B.A.T.M.A.N.] [PATCH 05/28] batman-adv: free neighbors when an interface is deactivated

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de hardif_disable_interface() calls purge_orig_ref() to immediately free all neighbors associated with the interface that is going down. purge_orig_neighbors() checked if the interface status is IF_INACTIVE which is set to IF_NOT_IN_USE shortly before

[B.A.T.M.A.N.] [PATCH 06/28] batman-adv: protect neigh_nodes used outside of rcu_locks with refcounting

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/routing.c | 40 +++- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index

[B.A.T.M.A.N.] [PATCH 07/28] batman-adv: protect each hash row with rcu locks

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/hash.c | 34 net/batman-adv/hash.h | 73 net/batman-adv/icmp_socket.c |2 +

[B.A.T.M.A.N.] [PATCH 08/28] batman-adv: protect originator nodes with reference counters

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/originator.c | 61 -- net/batman-adv/originator.h |1 + net/batman-adv/routing.c| 33 ---

[B.A.T.M.A.N.] [PATCH 09/28] batman-adv: protect ogm counter arrays with spinlock

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/originator.c | 11 +-- net/batman-adv/routing.c| 27 +++ net/batman-adv/types.h |1 + 3 files changed, 33 insertions(+), 6

[B.A.T.M.A.N.] [PATCH 10/28] batman-adv: protect bonding with rcu locks

2011-03-05 Thread Sven Eckelmann
From: Simon Wunderlich s...@hrz.tu-chemnitz.de bonding / alternating candidates need to be secured by rcu locks as well. This patch therefore converts the bonding list from a plain pointer list to a rcu securable lists and references the bonding candidates. Signed-off-by: Simon Wunderlich

[B.A.T.M.A.N.] [PATCH 11/28] batman-adv: Correct rcu refcounting for neigh_node

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race

[B.A.T.M.A.N.] [PATCH 12/28] batman-adv: Correct rcu refcounting for gw_node

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race

[B.A.T.M.A.N.] [PATCH 13/28] batman-adv: Correct rcu refcounting for softif_neigh

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race

[B.A.T.M.A.N.] [PATCH 14/28] batman-adv: Correct rcu refcounting for batman_if

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race

[B.A.T.M.A.N.] [PATCH 17/28] batman-adv: Make bat_priv-curr_gw an rcu protected pointer

2011-03-05 Thread Sven Eckelmann
From: Linus Lüssing linus.luess...@ascom.ch The rcu protected macros rcu_dereference() and rcu_assign_pointer() for the bat_priv-curr_gw need to be used, as well as spin/rcu locking. Otherwise we might end up using a curr_gw pointer pointing to already freed memory. Reported-by: Sven Eckelmann

[B.A.T.M.A.N.] [PATCH 18/28] batman-adv: Increase orig_node refcount before releasing rcu read lock

2011-03-05 Thread Sven Eckelmann
From: Linus Lüssing linus.luess...@ascom.ch When unicast_send_skb() is increasing the orig_node's refcount another thread might have been freeing this orig_node already. We need to increase the refcount in the rcu read lock protected area to avoid that. Signed-off-by: Linus Lüssing

[B.A.T.M.A.N.] [PATCH 20/28] batman-adv: separate ethernet comparing calls from hash functions

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Note: The function compare_ether_addr() provided by the Linux kernel requires aligned memory. Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/hard-interface.c|2 +- net/batman-adv/main.c |2 +-

[B.A.T.M.A.N.] [PATCH 19/28] batman-adv: Fix possible buffer overflow in softif neigh list output

2011-03-05 Thread Sven Eckelmann
From: Linus Lüssing linus.luess...@ascom.ch When printing the soft interface table the number of entries in the softif neigh list are first being counted and a fitting buffer allocated. After that the softif neigh list gets locked again and the buffer printed - which has the following two issues:

[B.A.T.M.A.N.] [PATCH 22/28] batman-adv: Correct rcu refcounting for orig_node

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de It might be possible that 2 threads access the same data in the same rcu grace period. The first thread calls call_rcu() to decrement the refcount and free the data while the second thread increases the refcount to use the data. To avoid this race

[B.A.T.M.A.N.] [PATCH 23/28] batman-adv: increase refcount in create_neighbor to be consistent

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/originator.c |4 ++- net/batman-adv/routing.c| 63 ++ 2 files changed, 30 insertions(+), 37 deletions(-) diff --git

[B.A.T.M.A.N.] [PATCH 24/28] batman-adv: remove orig_hash spinlock

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/icmp_socket.c | 16 ++--- net/batman-adv/main.c|1 - net/batman-adv/originator.c | 21 net/batman-adv/routing.c | 75

[B.A.T.M.A.N.] [PATCH 25/28] batman-adv: rename global if_list to hardif_list

2011-03-05 Thread Sven Eckelmann
From: Marek Lindner lindner_ma...@yahoo.de Batman-adv works with hard interfaces as well as soft interfaces. The new name should better make clear which kind of interfaces this list stores. Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/hard-interface.c | 28

[B.A.T.M.A.N.] [PATCH 27/28] batman-adv: Remove unused hdr_size variable in route_unicast_packet()

2011-03-05 Thread Sven Eckelmann
From: Linus Lüssing linus.luess...@ascom.ch Signed-off-by: Linus Lüssing linus.luess...@ascom.ch Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- net/batman-adv/routing.c|7 +++ net/batman-adv/routing.h|3 +-- net/batman-adv/soft-interface.c |2 +- 3 files

[B.A.T.M.A.N.] [PATCH 28/28] batman-adv: Disallow regular interface as mesh device

2011-03-05 Thread Sven Eckelmann
When trying to associate a net_device with another net_device which already exists, batman-adv assumes that this interface is a fully initialized batman mesh interface without checking it. The behaviour when accessing data behind netdev_priv of a random net_device is undefined and potentially

Re: [B.A.T.M.A.N.] pull request: batman-adv 2011-03-05

2011-03-05 Thread Sven Eckelmann
On Saturday 05 March 2011 13:28:14 Sven Eckelmann wrote: Hi, I was asked to submit following pull request for net-next-2.6/linux-2.6.39. It contains Marek's hard work (and of course related work by other people) to remove the orig_hash (aka the batman-adv private big kernel lock). Small

[B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Protect global TQ value and window with a spinlock

2011-03-05 Thread Linus Lüssing
Signed-off-by: Linus Lüssing linus.luess...@web.de --- originator.c |1 + routing.c|4 types.h |1 + 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/batman-adv/originator.c b/batman-adv/originator.c index 31c6b5a..8db9c33 100644 ---