Skip to content

Commit 4d1b81c

Browse files
edumazetwtarreau
authored andcommitted
net: neigh: guard against NULL solicit() method
commit 48481c8 upstream. 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: Willy Tarreau <w@1wt.eu>
1 parent c1b4204 commit 4d1b81c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/core/neighbour.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,8 @@ static void neigh_probe(struct neighbour *neigh)
872872
if (skb)
873873
skb = skb_copy(skb, GFP_ATOMIC);
874874
write_unlock(&neigh->lock);
875-
neigh->ops->solicit(neigh, skb);
875+
if (neigh->ops->solicit)
876+
neigh->ops->solicit(neigh, skb);
876877
atomic_inc(&neigh->probes);
877878
kfree_skb(skb);
878879
}

0 commit comments

Comments
 (0)