Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DoS attack against TCP services



In article <Pine.NEB.4.64.1502050025530.812%6bone.informatik.uni-leipzig.de@localhost>,
 <6bone%6bone.informatik.uni-leipzig.de@localhost> wrote:
>dmesg reports in loger intervals:
>
>nd6_storelladdr: something odd happens
>
>I do not know if this is the cause for the TIME_WAIT connections or a 
>consequence of TIME_WAIT connections.
>

Ok, I've been debugging memory initializations issues with link
layer sockets and ipv6 and I committed the following at HEAD which
fixes the problem for me:

Index: route.c
===================================================================
RCS file: /cvsroot/src/sys/net/route.c,v
retrieving revision 1.132
retrieving revision 1.134
diff -u -r1.132 -r1.134
--- route.c	6 Jun 2014 01:27:32 -0000	1.132
+++ route.c	2 Dec 2014 19:57:11 -0000	1.134
@@ -857,7 +841,7 @@
 		sockaddr_free(rt->rt_gateway);
 	KASSERT(rt->_rt_key != NULL);
 	RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
-	if ((rt->rt_gateway = sockaddr_dup(gate, M_NOWAIT)) == NULL)
+	if ((rt->rt_gateway = sockaddr_dup(gate, M_ZERO | M_NOWAIT)) == NULL)
 		return ENOMEM;
 	KASSERT(rt->_rt_key != NULL);
 	RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
@@ -1346,7 +1330,7 @@
 
 	KASSERT(ro->_ro_rt == NULL);
 
-	if ((ro->ro_sa = sockaddr_dup(sa, M_NOWAIT)) == NULL) {
+	if ((ro->ro_sa = sockaddr_dup(sa, M_ZERO | M_NOWAIT)) == NULL) {
 		rtcache_invariants(ro);
 		return ENOMEM;
 	}
@@ -1360,7 +1344,7 @@
 	if (rt->rt_tag != tag) {
 		if (rt->rt_tag != NULL)
 			sockaddr_free(rt->rt_tag);
-		rt->rt_tag = sockaddr_dup(tag, M_NOWAIT);
+		rt->rt_tag = sockaddr_dup(tag, M_ZERO | M_NOWAIT);
 	}
 	return rt->rt_tag; 
 }

Can you try this and see if you see the problem anymore?

Thanks,

christos



Home | Main Index | Thread Index | Old Index