From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: Invalid length provided for SMBIOS data Date: Tue, 3 Oct 2006 21:08:51 +0100 Message-ID: <20061003200850.GC29356@redhat.com> References: <1159798240.27206.13.camel@localhost> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com, aball@us.ibm.com List-Id: xen-devel@lists.xenproject.org --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 02, 2006 at 06:13:37PM +0100, Keir Fraser wrote: > I've checked in a simplification of the SMBIOS code as changeset 11686 in > xen-unstable. Since this entirely removes the code that computes the table > size 'ahead of time', it is very likely to fix this bug. We now *definitely* > write the number of bytes that we actually emitted when constructing the > tables. So unless the tables themselves are screwed, the length field must > now surely be correct. And indeed the one of the tables was screwed. There is a sneaky typo in calculating how far to advance the pointer in the CPU table - its doing strlen(buf) instead of strlen(cpu_manufactuerer) which on my particular system offset things by 6 bytes. Attaching the trivial patch to fix it - applies on top of your patch in 11686. Signed-of-by: Daniel P. Berrange Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-smbios-length-2.patch" diff -ru xen-3.0.3-testing-11633.smbios-orig/tools/firmware/hvmloader/smbios.c xen-3.0.3-testing-11633.smbios/tools/firmware/hvmloader/smbios.c --- xen-3.0.3-testing-11633.smbios-orig/tools/firmware/hvmloader/smbios.c 2006-10-03 16:02:57.000000000 -0400 +++ xen-3.0.3-testing-11633.smbios/tools/firmware/hvmloader/smbios.c 2006-10-03 16:01:17.000000000 -0400 @@ -434,7 +434,7 @@ start += strlen(buf) + 1; strcpy((char *)start, cpu_manufacturer); - start += strlen(buf) + 1; + start += strlen(cpu_manufacturer) + 1; *((uint8_t *)start) = 0; return start+1; --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --BOKacYhQ+x31HxR3--