All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net
Cc: David Ahern <dsahern@kernel.org>,
	Kasper Dupont <kasperd@gjkwv.06.feb.2021.kasperd.net>,
	Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Subject: [PATCH net] neighbour: allow NUD_NOARP entries to be forced GCed
Date: Mon,  7 Jun 2021 11:35:30 -0600	[thread overview]
Message-ID: <20210607173530.46493-1-dsahern@kernel.org> (raw)

IFF_POINTOPOINT interfaces use NUD_NOARP entries for IPv6. It's possible to
fill up the neighbour table with enough entries that it will overflow for
valid connections after that.

This behaviour is more prevalent after commit 58956317c8de ("neighbor:
Improve garbage collection") is applied, as it prevents removal from
entries that are not NUD_FAILED, unless they are more than 5s old.

Fixes: 58956317c8de (neighbor: Improve garbage collection)
Reported-by: Kasper Dupont <kasperd@gjkwv.06.feb.2021.kasperd.net>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
rebased to net tree

 net/core/neighbour.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 98f20efbfadf..bf774575ad71 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -238,6 +238,7 @@ static int neigh_forced_gc(struct neigh_table *tbl)
 
 			write_lock(&n->lock);
 			if ((n->nud_state == NUD_FAILED) ||
+			    (n->nud_state == NUD_NOARP) ||
 			    (tbl->is_multicast &&
 			     tbl->is_multicast(n->primary_key)) ||
 			    time_after(tref, n->updated))
-- 
2.24.3 (Apple Git-128)


             reply	other threads:[~2021-06-07 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 17:35 David Ahern [this message]
2021-06-07 18:53 ` [PATCH net] neighbour: allow NUD_NOARP entries to be forced GCed Roopa Prabhu
2021-06-07 22:04   ` David Ahern
2021-06-07 22:16     ` Roopa Prabhu
2021-06-07 22:26 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210607173530.46493-1-dsahern@kernel.org \
    --to=dsahern@kernel.org \
    --cc=cascardo@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kasperd@gjkwv.06.feb.2021.kasperd.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.