From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jz8P5-0005IR-Rd for mharc-grub-devel@gnu.org; Thu, 22 May 2008 06:52:11 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jz8P3-0005HP-NR for grub-devel@gnu.org; Thu, 22 May 2008 06:52:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jz8P0-0005Fn-IG for grub-devel@gnu.org; Thu, 22 May 2008 06:52:07 -0400 Received: from [199.232.76.173] (port=60438 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jz8Oz-0005Ff-Tn for grub-devel@gnu.org; Thu, 22 May 2008 06:52:06 -0400 Received: from c60.cesmail.net ([216.154.195.49]:27685) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1Jz8Oz-00067T-5u for grub-devel@gnu.org; Thu, 22 May 2008 06:52:05 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 22 May 2008 06:52:04 -0400 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id B4C9B619058; Thu, 22 May 2008 06:52:03 -0400 (EDT) From: Pavel Roskin To: "Isaac M. Marcos" In-Reply-To: <200805212021.11751.isaacmarcos100010@gmail.com> References: <200805080454.54578.isaacmarcos100010@gmail.com> <3ac92b10805161048q6b4e12b4kd8cca66644d904a9@mail.gmail.com> <1210960960.19414.6.camel@dv> <200805212021.11751.isaacmarcos100010@gmail.com> Content-Type: text/plain Date: Thu, 22 May 2008 06:52:02 -0400 Message-Id: <1211453522.24846.3.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Cc: grub-devel@gnu.org Subject: Re: grub-probe gets a segfault 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: Thu, 22 May 2008 10:52:10 -0000 On Wed, 2008-05-21 at 20:20 -0430, Isaac M. Marcos wrote: > Today, I bump on this problem again on updating kernel. Because of this fault, > update-initramfs reports a failure. It can't find "/". > > grub-probe -t device / --> segfault!! This patch should help. It checks for the buffer overrun. I still feel uneasy about applying it because it hides a bigger problem. diff --git a/disk/lvm.c b/disk/lvm.c index 1d898ff..997d15c 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -302,9 +302,12 @@ grub_lvm_scan_device (const char *name) rlocn = mdah->raw_locns; p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset); - while (*q != ' ') + while (*q != ' ' && q < metadatabuf + mda_size) q++; + if (q == metadatabuf + mda_size) + goto fail2; + vgname_len = q - p; vgname = grub_malloc (vgname_len + 1); if (!vgname) -- Regards, Pavel Roskin