From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40196 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFPKf-0002f8-Sr for qemu-devel@nongnu.org; Mon, 08 Nov 2010 05:52:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFPKW-0007CI-Qi for qemu-devel@nongnu.org; Mon, 08 Nov 2010 05:52:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFPKW-0007C5-JH for qemu-devel@nongnu.org; Mon, 08 Nov 2010 05:52:04 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA8Aq3xC018427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Nov 2010 05:52:03 -0500 Date: Mon, 8 Nov 2010 12:51:58 +0200 From: "Michael S. Tsirkin" Message-ID: <20101108105158.GA983@redhat.com> References: <20101105205148.8161.25164.stgit@s20.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101105205148.8161.25164.stgit@s20.home> Subject: [Qemu-devel] Re: [PATCH] e1000: Fix TCP checksum overflow with TSO List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: dwu@redhat.com, qemu-devel@nongnu.org On Fri, Nov 05, 2010 at 02:52:08PM -0600, Alex Williamson wrote: > When adding the length to the pseudo header, we're not properly > accounting for overflow. > > From: Mark Wu > Signed-off-by: Alex Williamson Thanks, applied. > --- > > hw/e1000.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/hw/e1000.c b/hw/e1000.c > index 532efdc..677165f 100644 > --- a/hw/e1000.c > +++ b/hw/e1000.c > @@ -384,9 +384,12 @@ xmit_seg(E1000State *s) > } else // UDP > cpu_to_be16wu((uint16_t *)(tp->data+css+4), len); > if (tp->sum_needed & E1000_TXD_POPTS_TXSM) { > + unsigned int phsum; > // add pseudo-header length before checksum calculation > sp = (uint16_t *)(tp->data + tp->tucso); > - cpu_to_be16wu(sp, be16_to_cpup(sp) + len); > + phsum = be16_to_cpup(sp) + len; > + phsum = (phsum >> 16) + (phsum & 0xffff); > + cpu_to_be16wu(sp, phsum); > } > tp->tso_frames++; > }