All of lore.kernel.org
 help / color / mirror / Atom feed
* grub 1.96 svn 20080813 and circular lvm2 metadata
@ 2008-08-28 11:14 Hans Lambermont
  2008-08-28 11:25 ` Felix Zielcke
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Lambermont @ 2008-08-28 11:14 UTC (permalink / raw)
  To: grub-devel; +Cc: Jan Derk Gerlings

Hi all,

My colleague Jan Derk Gerlings found a bug in the way grub 1.96, svn
version 20080813 (and earlier) reads the circular lvm2 metadata buffer.

If the lvm2 metadata is too large to fit in the buffer given an offset,
then it is continued at the start of the buffer. In this case the
current grub-setup will exit with a segmentation fault and on boot grub
will not find the root drive.

The origin of this bug is traced to the way grub handles lvm2 metadata.
Lvm2 has defined (and uses) the on-disk metadata as a circular list.
Each change to the metadate (lvm lvchange, lvm create, lvm remove, etc.)
forces lvm to write the complete metadata to the circular buffer. It
will be placed after the last instance of the metadata with a new
sequence number.

When the end of the buffer is reached, lvm will continue (wrap-around
to) at the start of the buffer. Grub treats the buffer as linear, so
when wrap-around occurs grub fails because it does not continue at the
start of the buffer. This results in the grub-setup segmentation error,
and the inability to boot.

On request we can send two (literal) copies of the circular buffer (it's
too big for the mailing list 100kibi limit).
In md0_ok.txt the latest sequence number of the metadata is 280. It ends
before it reaches the end of the buffer. Grub-install works and the
machine boots.
In md0_err the latest sequence number of the metadata is 282. It wraps
around at the end of the buffer, continuing at the start of the buffer.
The end of the metadata comes before the start. Grub-install fails and
so does the boot.

At grub-1.96_svn20080813/disk/lvm.c line 303 and further down the notion
of circular metadata is not taken into account.

Shall we attempt to fix this and send a patch ?

regards,
   Hans Lambermont, Jan Derk Gerlings
-- 
Hans Lambermont, M.Sc.  -  Newtec  -  OS-Platform&VAS
http://newtec.eu/    t:+31408519234    m:+31629064887



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-10-05 10:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-28 11:14 grub 1.96 svn 20080813 and circular lvm2 metadata Hans Lambermont
2008-08-28 11:25 ` Felix Zielcke
2008-08-29  9:00   ` Hans Lambermont
2008-08-29  9:31     ` Felix Zielcke
2008-08-29 15:00       ` Vesa Jääskeläinen
2008-08-29 15:22         ` Felix Zielcke
2008-08-29 15:37         ` Marco Gerards
2008-08-29 16:08     ` Marco Gerards
2008-09-03  6:49       ` Felix Zielcke
2008-09-03 21:15       ` Felix Zielcke
2008-09-08 10:28         ` Hans Lambermont
2008-09-09 13:03         ` Hans Lambermont
2008-09-23  8:29           ` Hans Lambermont
2008-09-23  8:58             ` Felix Zielcke
2008-09-24  9:45               ` Robert Millan
2008-09-30 12:34                 ` Hans Lambermont
2008-10-05 10:50                   ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.