neighbour: allow NUD_NOARP entries to be forced GCed
Subsystems (2)
PATCH 1/1 neighbour: allow NUD_NOARP entries to be forced GCed
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.
---
rebased to net tree
net/core/neighbour.c | 1 + 1 file changed, 1 insertion(+)
net/core/neighbour.c +1 -0
@@ -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))
Signature · 1 line
2.24.3 (Apple Git-128)
Quoted 8 lines · David Ahern
IFF_POINTOPOINTinterfaces useNUD_NOARPentries 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 notNUD_FAILED, unless they are more than 5s old.
Quoted 6 lines
Fixes 58956317c8de (neighbor: Improve garbage collection)Reported-by Kasper Dupont <[email protected]>Signed-off-by Thadeu Lima de Souza Cascardo <[email protected]>Signed-off-by David Ahern <[email protected]>---
rebased to net tree
There are other use-cases that use NUD_NOARP as static neighbour entries which should be exempt from forced gc.
for example when qualified by NTF_EXT_LEARNED for the E-VPN use-case.
The check in your patch below should exclude NTF_EXT_LEARNED entries.
(unrelated to the neighbour code , but bridge driver also uses NUD_NOARP for static entries)
Quoted 16 lines
net/core/neighbour.c | 1 + 1 file changed, 1 insertion(+)net/core/neighbour.c +1
-0@@ -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))
Quoted 22 lines · Roopa Prabhu
Quoted 9 lines · David Ahern
IFF_POINTOPOINTinterfaces useNUD_NOARPentries 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 notNUD_FAILED, unless they are more than 5s old.Quoted 6 lines
Fixes 58956317c8de (neighbor: Improve garbage collection)Reported-by Kasper Dupont <[email protected]>Signed-off-by Thadeu Lima de Souza Cascardo <[email protected]>Signed-off-by David Ahern <[email protected]>---
rebased to net treeThere are other use-cases that use
NUD_NOARPas static neighbour entries which should be exempt from forced gc.
Quoted 9 lines
for example when qualified by
NTF_EXT_LEARNEDfor the E-VPN use-case.The check in your patch below should exclude
NTF_EXT_LEARNEDentries.(unrelated to the neighbour code , but bridge driver also uses
NUD_NOARPfor static entries)
Maybe I misunderstand your comment: forced_gc does not apply to static entries; those were moved to a separate list to avoid walking them.
Quoted 26 lines · David Ahern
Quoted 25 lines · Roopa Prabhu
Quoted 9 lines · David Ahern
IFF_POINTOPOINTinterfaces useNUD_NOARPentries 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 notNUD_FAILED, unless they are more than 5s old.Quoted 6 lines
Fixes 58956317c8de (neighbor: Improve garbage collection)Reported-by Kasper Dupont <[email protected]>Signed-off-by Thadeu Lima de Souza Cascardo <[email protected]>Signed-off-by David Ahern <[email protected]>---
rebased to net treeThere are other use-cases that use
NUD_NOARPas static neighbour entries which should be exempt from forced gc.for example when qualified by
NTF_EXT_LEARNEDfor the E-VPN use-case.The check in your patch below should exclude
NTF_EXT_LEARNEDentries.
Quoted 7 lines
Quoted 4 lines
(unrelated to the neighbour code , but bridge driver also uses
NUD_NOARPfor static entries)Maybe I misunderstand your comment:
forced_gcdoes not apply to static entries; those were moved to a separate list to avoid walking them.
I think you are right. so just to confirm, NUD_NOARP + NTF_EXT_LEARNED will never be included in the list for forced_gc and hence not affected by your patch ?
if yes, I am good.
From: David Ahern <[email protected]>
Date: Mon, 7 Jun 2021 11:35:30 -0600
Quoted 8 lines
IFF_POINTOPOINTinterfaces useNUD_NOARPentries 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 notNUD_FAILED, unless they are more than 5s old.
Quoted 6 lines
Fixes 58956317c8de (neighbor: Improve garbage collection)Reported-by Kasper Dupont <[email protected]>Signed-off-by Thadeu Lima de Souza Cascardo <[email protected]>Signed-off-by David Ahern <[email protected]>---
rebased to net tree
Applied, thanks.