From: Sven Eckelmann <sven@narfation.org> Date: 2011-01-30 12:11:49
Hi,
I would like to propose following patches for net-2.6.git/2.6.38. These are
important fixes for kernel oopses/memory leaks. I already send this exact same
request in 201101301036.57928.sven@narfation.org were you requested a new patch
series posting.
I cannot reduce the number of fixes any more because it makes no sense to fix
one Oops and leave the other one open. I've already removed the fixes for the
protocol implementation errors from the first patchset.
The following changes since commit aa0adb1a85e159cf57f0e11282bc6c9e3606a5f3:
batman-adv: Use "__attribute__" shortcut macros (2011-01-16 03:25:19 +0100)
are available in the git repository at:
git://git.open-mesh.org/ecsv/linux-merge.git batman-adv/merge-oopsonly
Linus Lüssing (1):
batman-adv: Fix kernel panic when fetching vis data on a vis server
Sven Eckelmann (3):
batman-adv: Remove vis info on hashing errors
batman-adv: Remove vis info element in free_info
batman-adv: Make vis info stack traversal threadsafe
net/batman-adv/vis.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
Thanks,
Sven
From: Sven Eckelmann <sven@narfation.org> Date: 2011-01-30 12:11:52
From: Linus Lüssing <redacted>
The hash_iterate removal introduced a bug leading to a kernel panic when
fetching the vis data on a vis server. That commit forgot to rename one
variable name, which this commit fixes now.
Reported-by: Russell Senior <redacted>
Signed-off-by: Linus Lüssing <redacted>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/vis.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
From: Sven Eckelmann <sven@narfation.org> Date: 2011-01-30 12:11:54
A newly created vis info object must be removed when it couldn't be
added to the hash. The old_info which has to be replaced was already
removed and isn't related to the hash anymore.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/vis.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -444,7 +444,7 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv,info);if(hash_added<0){/* did not work (for some reason) */-kref_put(&old_info->refcount,free_info);+kref_put(&info->refcount,free_info);info=NULL;}
From: Sven Eckelmann <sven@narfation.org> Date: 2011-01-30 12:11:57
The free_info function will be called when no reference to the info
object exists anymore. It must be ensured that the allocated memory
gets freed and not only the elements which are managed by the info
object.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/vis.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
@@ -64,6 +64,7 @@ static void free_info(struct kref *ref)spin_unlock_bh(&bat_priv->vis_list_lock);kfree_skb(info->skb_packet);+kfree(info);}/* Compare two vis packets, used by the hashing algorithm */
From: Sven Eckelmann <sven@narfation.org> Date: 2011-01-30 12:12:00
The batman-adv vis server has to a stack which stores all information
about packets which should be send later. This stack is protected
with a spinlock that is used to prevent concurrent write access to it.
The send_vis_packets function has to take all elements from the stack
and send them to other hosts over the primary interface. The send will
be initiated without the lock which protects the stack.
The implementation using list_for_each_entry_safe has the problem that
it stores the next element as "safe ptr" to allow the deletion of the
current element in the list. The list may be modified during the
unlock/lock pair in the loop body which may make the safe pointer
not pointing to correct next element.
It is safer to remove and use the first element from the stack until no
elements are available. This does not need reduntant information which
would have to be validated each time the lock was removed.
Reported-by: Russell Senior <redacted>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/vis.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2011-01-31 06:18:57
From: Sven Eckelmann <sven@narfation.org>
Date: Sun, 30 Jan 2011 13:11:40 +0100
Hi,
I would like to propose following patches for net-2.6.git/2.6.38. These are
important fixes for kernel oopses/memory leaks. I already send this exact same
request in 201101301036.57928.sven@narfation.org were you requested a new patch
series posting.
I cannot reduce the number of fixes any more because it makes no sense to fix
one Oops and leave the other one open. I've already removed the fixes for the
protocol implementation errors from the first patchset.
The following changes since commit aa0adb1a85e159cf57f0e11282bc6c9e3606a5f3:
batman-adv: Use "__attribute__" shortcut macros (2011-01-16 03:25:19 +0100)
are available in the git repository at:
git://git.open-mesh.org/ecsv/linux-merge.git batman-adv/merge-oopsonly