Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633926 > unrolled thread

[PATCH 4.10 04/62] net: neigh: guard against NULL solicit() method

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-05-01 23:50 +0200
Last post2017-05-01 23:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.10 04/62] net: neigh: guard against NULL solicit() method Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-01 23:50 +0200

#1633926 — [PATCH 4.10 04/62] net: neigh: guard against NULL solicit() method

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-05-01 23:50 +0200
Subject[PATCH 4.10 04/62] net: neigh: guard against NULL solicit() method
Message-ID<tCrmF-5Yj-5@gated-at.bofh.it>
4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>


[ Upstream commit 48481c8fa16410ffa45939b13b6c53c2ca609e5f ]

Dmitry posted a nice reproducer of a bug triggering in neigh_probe()
when dereferencing a NULL neigh->ops->solicit method.

This can happen for arp_direct_ops/ndisc_direct_ops and similar,
which can be used for NUD_NOARP neighbours (created when dev->header_ops
is NULL). Admin can then force changing nud_state to some other state
that would fire neigh timer.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/neighbour.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -860,7 +860,8 @@ static void neigh_probe(struct neighbour
 	if (skb)
 		skb = skb_clone(skb, GFP_ATOMIC);
 	write_unlock(&neigh->lock);
-	neigh->ops->solicit(neigh, skb);
+	if (neigh->ops->solicit)
+		neigh->ops->solicit(neigh, skb);
 	atomic_inc(&neigh->probes);
 	kfree_skb(skb);
 }

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web