Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HeIrc-0005MJ-CX for mharc-grub-devel@gnu.org; Wed, 18 Apr 2007 18:43:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HeIrb-0005Lm-5P for grub-devel@gnu.org; Wed, 18 Apr 2007 18:42:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HeIrW-0005LF-MZ for grub-devel@gnu.org; Wed, 18 Apr 2007 18:42:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeIrW-0005LC-Jz for grub-devel@gnu.org; Wed, 18 Apr 2007 18:42:54 -0400 Received: from an-out-0708.google.com ([209.85.132.242]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HeImd-0005tb-H1 for grub-devel@gnu.org; Wed, 18 Apr 2007 18:37:51 -0400 Received: by an-out-0708.google.com with SMTP id b8so374113ana for ; Wed, 18 Apr 2007 15:37:50 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qxcgUUsBEnpuvh+iNWFmGNnJuFiDH1nKyGpOrMwQhEaat1uVHS3StyHdObob+b4OUKgk2gC5V4tydQmi8B+QQ5lnxYpf776ZyhwFSGfSYkAe8i7m88V55xswPD3U12MODe6s19kBhi0w7gOQru+SbqRH0EdsfK+zld8RBmF6v84= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JASAlZxv+8PhHD9Fef1LJrbCPDq1dpl335AxvI4FE3m205+u96zmc8DDA274Y8QlmWsAAXI/3lcYAGPDmclmCVr1SIYdVgmqqBx+iXKy74Q18X9AF8DFRLA/6R1xbnTO9Pu64u7NfoqDDliLNdl5PZyq/r2n63UT9gn3LRRmi94= Received: by 10.100.124.5 with SMTP id w5mr758410anc.1176935870305; Wed, 18 Apr 2007 15:37:50 -0700 (PDT) Received: by 10.100.43.5 with HTTP; Wed, 18 Apr 2007 15:37:50 -0700 (PDT) Message-ID: <9f50a7a00704181537m6ae2f72dx45f7c0538da5f275@mail.gmail.com> Date: Wed, 18 Apr 2007 17:37:50 -0500 From: "Jerone Young" To: "The development of GRUB 2" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-detected-kernel: Linux 2.6 (newer, 2) Subject: Re: Issue in cvs kern/elf.c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2007 22:42:59 -0000 This is an obvious problem. Thanks for finding it Pattrick! I will commit the fix today. On 4/18/07, Pattrick Hueper wrote: > Hi all, > > testing grub2 on a 64bit platform i found an issue in kern/elf.c method > grub_elf64_load. > > There are parentheses missing after the compare of read bytes and expected > filesize causing the load to always fail with GRUB_ERR_BAD_OS. > > Here is the cvs patch that fixed the issue for me: > > Index: kern/elf.c > =================================================================== > RCS file: /cvsroot/grub/grub2/kern/elf.c,v > retrieving revision 1.5 > diff -u -r1.5 elf.c > --- kern/elf.c 20 Feb 2007 22:46:12 -0000 1.5 > +++ kern/elf.c 18 Apr 2007 09:02:44 -0000 > @@ -432,12 +432,14 @@ > grub_ssize_t read; > read = grub_file_read (elf->file, (void *) load_addr, > phdr->p_filesz); > if (read != (grub_ssize_t) phdr->p_filesz) > - /* XXX How can we free memory from `load_hook'? */ > - grub_error_push (); > - return grub_error (GRUB_ERR_BAD_OS, > - "Couldn't read segment from file: " > - "wanted 0x%lx bytes; read 0x%lx bytes.", > - phdr->p_filesz, read); > + { > + /* XXX How can we free memory from `load_hook'? */ > + grub_error_push (); > + return grub_error (GRUB_ERR_BAD_OS, > + "Couldn't read segment from file: " > + "wanted 0x%lx bytes; read 0x%lx bytes.", > + phdr->p_filesz, read); > + } > } > > if (phdr->p_filesz < phdr->p_memsz) > > > Best Regards, Pattrick > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > >