[3.16.y-ckt stable] Patch "batman-adv: avoid NULL dereferences and fix if check" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Mon Jan 19 13:37:26 UTC 2015
This is a note to let you know that I have just added a patch titled
batman-adv: avoid NULL dereferences and fix if check
to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue
This patch is scheduled to be released in version 3.16.7-ckt5.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 915dfc8083ea19eb421154aaa522f855d970820c Mon Sep 17 00:00:00 2001
From: Antonio Quartulli <antonio at meshcoding.com>
Date: Sat, 20 Dec 2014 13:48:57 +0100
Subject: batman-adv: avoid NULL dereferences and fix if check
commit 0d1644919578db525b9a7b6c8197ce02adbfce26 upstream.
Gateway having bandwidth_down equal to zero are not accepted
at all and so never added to the Gateway list.
For this reason checking the bandwidth_down member in
batadv_gw_out_of_range() is useless.
This is probably a copy/paste error and this check was supposed
to be "!gw_node" only. Moreover, the way the check is written
now may also lead to a NULL dereference.
Fix this by rewriting the if-condition properly.
Introduced by 414254e342a0d58144de40c3da777521ebaeeb07
("batman-adv: tvlv - gateway download/upload bandwidth container")
Signed-off-by: Antonio Quartulli <antonio at meshcoding.com>
Reported-by: David Binderman <dcb314 at hotmail.com>
Signed-off-by: Marek Lindner <mareklindner at neomailbox.ch>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
net/batman-adv/gateway_client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 90cff585b37d..e0bcf9e84273 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -810,7 +810,7 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
goto out;
gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
- if (!gw_node->bandwidth_down == 0)
+ if (!gw_node)
goto out;
switch (atomic_read(&bat_priv->gw_mode)) {
--
2.1.4
More information about the kernel-team
mailing list