[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <DUB123-W2663266CEA8296935E9450A0B30@phx.gbl>
Date: Mon, 22 Sep 2014 11:11:19 +0200
From: Mario Pirker <mariopirker@...mail.com>
To: "mareklindner@...mailbox.ch" <mareklindner@...mailbox.ch>,
"sw@...onwunderlich.de" <sw@...onwunderlich.de>,
"antonio@...hcoding.com" <antonio@...hcoding.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] batman-adv: fix potential NULL pointer dereferencing
>From b451e7317148e18bf6c5c8fd747d79ab34260354 Mon Sep 17 00:00:00 2001
From: Mario Pirker <mario.pirker@...logg.ox.ac.uk>
Date: Tue, 16 Sep 2014 17:55:13 +0200
Subject: [PATCH] batman-adv: fix potential NULL pointer dereferencing
The call batadv_gw_node_get may return NULL. The return value has to
be sanity checked before the pointer is dereferenced.
Signed-off-by: Mario Pirker <mariopirker@...mail.com>
---
net/batman-adv/gateway_client.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 90cff58..7ee0913 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -810,6 +810,11 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
goto out;
gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
+
+ /* gw_node can be NULL. We need to check before dereferencing */
+ if (gw_node == NULL)
+ goto out;
+
if (!gw_node->bandwidth_down == 0)
goto out;
--
1.8.1.4 --
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists