From owner-freebsd-net@FreeBSD.ORG Sat Apr 6 10:04:27 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F157BF0; Sat, 6 Apr 2013 10:04:27 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 9FE77819; Sat, 6 Apr 2013 10:04:26 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id fn20so680195lab.32 for ; Sat, 06 Apr 2013 03:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=F5ED1KxTfDI1gtBVP7cfi16YA8oPNV5wcJzjOrw34Zk=; b=TvSo5mUqR2BuwO903X9RvIxFF0sS+Vekh69hGGEeGh4IiBJKjf/6ngvT6eOnl61Ls6 WYV8Lby+a1JRr1iglRe+4IOfvFjdWuatc+35zvOZcvA3Te6p0MVR99fL0U0VXn/o3Rnm cvRzpZpbUFpQOr6lENWGIOA3crQKJbCt7CM5W5Mvq9wTYWGZQgYvbXaNMVIcgZ7XtW4x 0YQMmJZpzlrvEH3YLgx6ngfkBB900MlwSJ3Y0cLYGqd/MvL0esdWgbRxOCRMXt9dEBLg i60DXxAp9tA9d4FRD8NEOhCd7fk8AUs5cfR6y1lmWFcr8UGI1B8JwGUQB7jsPMDJz+ti OKmw== MIME-Version: 1.0 X-Received: by 10.112.76.39 with SMTP id h7mr6600035lbw.118.1365242665503; Sat, 06 Apr 2013 03:04:25 -0700 (PDT) Received: by 10.114.48.102 with HTTP; Sat, 6 Apr 2013 03:04:25 -0700 (PDT) In-Reply-To: <201304031530.r33FU1AY097998@freefall.freebsd.org> References: <201304031530.r33FU1AY097998@freefall.freebsd.org> Date: Sat, 6 Apr 2013 18:04:25 +0800 Message-ID: Subject: Re: misc/177456: An error of calculating TCP sequence number will resault in the machine to restart From: Sepherosa Ziehau To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Apr 2013 10:04:27 -0000 On Wed, Apr 3, 2013 at 11:30 PM, Gleb Smirnoff wrote: > The following reply was made to PR kern/177456; it has been noted by GNATS. > > From: Gleb Smirnoff > To: ?????? > Cc: bug-followup@FreeBSD.org > Subject: Re: misc/177456: An error of calculating TCP sequence number will > resault in the machine to restart > Date: Wed, 3 Apr 2013 19:21:12 +0400 > > Hi! > > On Wed, Apr 03, 2013 at 07:52:42AM +0800, ?????? wrote: > ?> I mean there is a bug in FreeBSD's tcp code. I'm trying to describe it by pictuer. Pelease see the attachments?? > > I am trying to model what you are describing in the picture by > special crafted code. > > I intentionally model memory allocation failure on first two > packets for a connection that has special socket option. > > I'm modelling allocation failure at tcp_output.c near line 900: > > Index: tcp_output.c > =================================================================== > --- tcp_output.c (revision 249051) > +++ tcp_output.c (working copy) > @@ -898,6 +898,13 @@ send: > else > TCPSTAT_INC(tcps_sndwinup); > > + /* Fail allocating first 2 packets. */ > + if (tp->t_flags & TF_ZHOPA && tp->t_zhopa < 2) { > + tp->t_zhopa++; > + m = NULL; > + error = ENOBUFS; > + goto out; > + } else > m = m_gethdr(M_NOWAIT, MT_DATA); > if (m == NULL) { > error = ENOBUFS; > > > I have no success in reproducing your problems. With above code, > first 2 packets are failing to allocate, but third retransmission > succeeds and connection is established with no problems. > > May be I incorrectly understand your description :( Please don't > give up and try to explain again. > > A modelling code that demonstrates problem would be appreciated. Hope the following analysis helps; IMHO, the reporter probably had hit the same bug: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ff9b7d322dc5a26f7173aa8c38ecb79da80e419 Best Regards, sephe -- Tomorrow Will Never Die On Wed, Apr 3, 2013 at 11:30 PM, Gleb Smirnoff wrote: > The following reply was made to PR kern/177456; it has been noted by GNATS. > > From: Gleb Smirnoff > To: ?????? > Cc: bug-followup@FreeBSD.org > Subject: Re: misc/177456: An error of calculating TCP sequence number will > resault in the machine to restart > Date: Wed, 3 Apr 2013 19:21:12 +0400 > > Hi! > > On Wed, Apr 03, 2013 at 07:52:42AM +0800, ?????? wrote: > ?> I mean there is a bug in FreeBSD's tcp code. I'm trying to describe it by pictuer. Pelease see the attachments?? > > I am trying to model what you are describing in the picture by > special crafted code. > > I intentionally model memory allocation failure on first two > packets for a connection that has special socket option. > > I'm modelling allocation failure at tcp_output.c near line 900: > > Index: tcp_output.c > =================================================================== > --- tcp_output.c (revision 249051) > +++ tcp_output.c (working copy) > @@ -898,6 +898,13 @@ send: > else > TCPSTAT_INC(tcps_sndwinup); > > + /* Fail allocating first 2 packets. */ > + if (tp->t_flags & TF_ZHOPA && tp->t_zhopa < 2) { > + tp->t_zhopa++; > + m = NULL; > + error = ENOBUFS; > + goto out; > + } else > m = m_gethdr(M_NOWAIT, MT_DATA); > if (m == NULL) { > error = ENOBUFS; > > > I have no success in reproducing your problems. With above code, > first 2 packets are failing to allocate, but third retransmission > succeeds and connection is established with no problems. > > May be I incorrectly understand your description :( Please don't > give up and try to explain again. > > A modelling code that demonstrates problem would be appreciated. > > -- > Totus tuus, Glebius. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" -- Tomorrow Will Never Die