Date: Thu, 22 Mar 2001 16:10:21 +0000 From: thinker <thinker@branda.to> To: freebsd-security@freebsd.org Subject: Hang forever at LAST_ACK Message-ID: <20010322161021.A45575@hell.branda.to>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010322161021.A45575>