[3.19.y-ckt stable] Patch "net/neighbour: fix crash at dumping device-agnostic proxy entries" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Dec 15 23:17:15 UTC 2015


This is a note to let you know that I have just added a patch titled

    net/neighbour: fix crash at dumping device-agnostic proxy entries

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue

This patch is scheduled to be released in version 3.19.8-ckt12.

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.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 39eb1e082cadc5349bd0c8369af14dfe92346eae Mon Sep 17 00:00:00 2001
From: Konstantin Khlebnikov <koct9i at gmail.com>
Date: Tue, 1 Dec 2015 01:14:48 +0300
Subject: net/neighbour: fix crash at dumping device-agnostic proxy entries

commit 6adc5fd6a142c6e2c80574c1db0c7c17dedaa42e upstream.

Proxy entries could have null pointer to net-device.

Signed-off-by: Konstantin Khlebnikov <koct9i at gmail.com>
Fixes: 84920c1420e2 ("net: Allow ipv6 proxies and arp proxies be shown with iproute2")
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 net/core/neighbour.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 0385351..9b1870d 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2239,7 +2239,7 @@ static int pneigh_fill_info(struct sk_buff *skb, struct pneigh_entry *pn,
 	ndm->ndm_pad2    = 0;
 	ndm->ndm_flags	 = pn->flags | NTF_PROXY;
 	ndm->ndm_type	 = RTN_UNICAST;
-	ndm->ndm_ifindex = pn->dev->ifindex;
+	ndm->ndm_ifindex = pn->dev ? pn->dev->ifindex : 0;
 	ndm->ndm_state	 = NUD_NONE;

 	if (nla_put(skb, NDA_DST, tbl->key_len, pn->key))
@@ -2313,7 +2313,7 @@ static int pneigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
 		if (h > s_h)
 			s_idx = 0;
 		for (n = tbl->phash_buckets[h], idx = 0; n; n = n->next) {
-			if (dev_net(n->dev) != net)
+			if (pneigh_net(n) != net)
 				continue;
 			if (idx < s_idx)
 				goto next;
--
1.9.1





More information about the kernel-team mailing list