From owner-freebsd-security Thu Mar 22 0: 7:44 2001 Delivered-To: freebsd-security@freebsd.org Received: from hell.branda.to (61-216-80-11.HINET-IP.hinet.net [61.216.80.11]) by hub.freebsd.org (Postfix) with ESMTP id B9DBA37B71E for ; Thu, 22 Mar 2001 00:07:40 -0800 (PST) (envelope-from thinker@branda.to) Received: from localhost (localhost [127.0.0.1]) (uid 1000) by hell.branda.to with local; Thu, 22 Mar 2001 16:10:21 +0000 Date: Thu, 22 Mar 2001 16:10:21 +0000 From: thinker To: freebsd-security@freebsd.org Subject: Hang forever at LAST_ACK Message-ID: <20010322161021.A45575@hell.branda.to> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, Few days ago, my friend has a FreeBSD 4.2-stable server be hanged totally for socket being exhausted. He found there are many sockets stay at LAST_ACK state and never been dropped. We don't know whether it is a DDoS attack, but it could be a DDoS way. I don't know whether there is people to fix it up, and I make a patch file for it following. It seems work fine. Kernel patch is following. --------- begin patch file of sys/netinet/tcp_usrreq.c ---------- --- tcp_usrreq.c.orig Thu Mar 22 14:59:45 2001 +++ tcp_usrreq.c Thu Mar 22 15:04:49 2001 @@ -1139,13 +1139,15 @@ tp->t_state = TCPS_LAST_ACK; break; } - if (tp && tp->t_state >= TCPS_FIN_WAIT_2) { + if (tp && tp->t_state >= TCPS_FIN_WAIT_2) soisdisconnected(tp->t_inpcb->inp_socket); - /* To prevent the connection hanging in FIN_WAIT_2 forever. */ - if (tp->t_state == TCPS_FIN_WAIT_2) - callout_reset(tp->tt_2msl, tcp_maxidle, - tcp_timer_2msl, tp); - } + /* + * To prevent the connection hanging in FIN_WAIT_2 & + * TCPS_LAST_ACK forever. + */ + if (tp->t_state == TCPS_FIN_WAIT_2 || tp->t_state == TCPS_LAST_ACK) + callout_reset(tp->tt_2msl, tcp_maxidle, + tcp_timer_2msl, tp); return (tp); } --------- end patch file of sys/netinet/tcp_usrreq.c ------------ -- thinker@branda.to Branda Open Site (BOS) thinker.bbs@bbs.yzu.edu.tw http://www.branda.to/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message