From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2354621DFA91C for ; Tue, 28 Mar 2017 23:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490770632; x=1522306632; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=lMSkOfixNzuK1NKr6TpS2GhZmMK4jTrfF71zLVa1J0g=; b=jRh3OEEPINutbcwqrWthaJDlM/0r5RVxJH7+qfekkTGCnen3nujWtnTv cyV1CsxOEOWG/kkwVwjpvfTwx+wjqQ==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2017 23:57:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,240,1486454400"; d="scan'208";a="1113191825" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 28 Mar 2017 23:57:11 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 28 Mar 2017 23:56:38 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 28 Mar 2017 23:56:38 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.224]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0248.002; Wed, 29 Mar 2017 14:56:36 +0800 From: "Tian, Feng" To: "atepin@kraftway.ru" , "edk2-devel@lists.01.org" , "Ye, Ting" , "Fu, Siyuan" , "Wu, Jiaxin" CC: "Tian, Feng" Thread-Topic: [PATCH 1/2] MdeModulePkg/Tcp4Dxe: Fix unconditional window shrinking Thread-Index: AQHSp5PDZGClaksp30eTLpb955itD6GrY1aQ Date: Wed, 29 Mar 2017 06:56:35 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699CFDB6@SHSMSX101.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/2] MdeModulePkg/Tcp4Dxe: Fix unconditional window shrinking X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 06:57:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Adding network module owners for further review. Thanks Feng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of atep= in@kraftway.ru Sent: Tuesday, March 28, 2017 3:20 PM To: edk2-devel@lists.01.org Subject: [edk2] [PATCH 1/2] MdeModulePkg/Tcp4Dxe: Fix unconditional window = shrinking Moving Right window edge to the left on sender side without additional chec= ks leads to the situation when sender assumes the receiver shrunk its rcv b= uffer, when, in fact, it only reduced window size. This is a TCP deadlock s= ituation. Receiver ACKs proper segment, while sender discards it for future= ACK. Add check for negative usable window to prevent erroneous window shri= nking. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrey Tepin --- MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c b/MdeModule= Pkg/Universal/Network/Tcp4Dxe/Tcp4Input.c index 1000538..ea0766a 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c @@ -703,6 +703,7 @@ TcpInput ( TCP_SEG *Seg; TCP_SEQNO Right; TCP_SEQNO Urg; + INT32 UsableWnd; =20 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); =20 @@ -1188,7 +1189,10 @@ TcpInput ( =20 if (TCP_SEQ_LT (Right, Tcb->SndNxt)) { =20 - Tcb->SndNxt =3D Right; + UsableWnd =3D Tcb->SndUna + Tcb->SndWnd - Tcb->SndNxt; + if (UsableWnd < 0) { + Tcb->SndNxt =3D Right; + } =20 if (Right =3D=3D Tcb->SndUna) { =20 -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel