lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 13 Sep 2012 05:15:58 +0200
From:	Eric Dumazet <>
To:	David Miller <>
Cc:	netdev <>,
	Lorenzo Colitti <>,
	Maciej ┼╗enczykowski <>,
	Tom Herbert <>,
	Willem de Bruijn <>
Subject: [PATCH v2 net-next] ipv6: prevent useless neigh alloc on PTP or lo

From: Eric Dumazet <>

We have special handling of SIT devices in addrconf_prefix_route()
to avoid allocating a neighbour for each destination.

If routing entry is :

ip -6 route add 2001:db8::/64 dev sit1

Then the kernel will create a new route and neighbour for every new
address under 2001:db8::/64 that we send a packet to 
(potentially, 2^64 routes and neighbours).

Under load, we immediately get the infamous "Neighbour table overflow"
message and machine eventually crash.

This does not happen if we specify a next-hop explicitly, like so:

ip -6 route add 2001:db8::/64 via fe80:: dev sit1

Same problem happens if we use routes to loopback.

Idea of this patch is to move existing SIT related code from
addrconf_prefix_route() to a more generic one in ip6_route_add(). 

This permits ip6_pol_route() to clone route instead of calling
rt6_alloc_cow() and allocate a neighbour.

Many thanks to Lorenzo for his help and suggestions.

Reported-by: Lorenzo Colitti <>
Signed-off-by: Eric Dumazet <>
Cc: Maciej ┼╗enczykowski <>
Cc: Tom Herbert <>
Cc: Willem de Bruijn <>
 net/ipv6/addrconf.c |   10 ----------
 net/ipv6/route.c    |    4 ++++
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1237d5d..c6837d2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1679,16 +1679,6 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
 	cfg.fc_dst = *pfx;
-	/* Prevent useless cloning on PtP SIT.
-	   This thing is done here expecting that the whole
-	   class of non-broadcast devices need not cloning.
-	 */
-#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
-	if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT))
-		cfg.fc_flags |= RTF_NONEXTHOP;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 399613b..7df8dfc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1540,6 +1540,10 @@ int ip6_route_add(struct fib6_config *cfg)
 	} else
 		rt->rt6i_prefsrc.plen = 0;
+	/* Prevent useless cloning on link types that don't have next hops. */
+	if (dev->flags & (IFF_POINTOPOINT | IFF_LOOPBACK))
+		cfg->fc_flags |= RTF_NONEXTHOP;
 	if (cfg->fc_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) {
 		err = rt6_bind_neighbour(rt, dev);
 		if (err)

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists