bin/98005: loader corrupts other files when rewriting nextboot.conf

Yar Tikhiy yar at comp.chem.msu.su
Wed May 31 00:40:19 PDT 2006


The following reply was made to PR bin/98005; it has been noted by GNATS.

From: Yar Tikhiy <yar at comp.chem.msu.su>
To: Ian Dowse <iedowse at iedowse.com>
Cc: FreeBSD-gnats-submit at FreeBSD.org
Subject: Re: bin/98005: loader corrupts other files when rewriting nextboot.conf
Date: Wed, 31 May 2006 11:36:28 +0400

 On Sat, May 27, 2006 at 01:05:01PM +0100, Ian Dowse wrote:
 > In message <200605271037.k4RAbtYw063346 at comp.chem.msu.su>, Yar Tikhiy writes:
 > >	When nextboot is in effect, loader(8) writes the modified
 > >	contents of the nextboot.conf file, or whatever nextboot_conf
 > >	is set to, to an incorrect location on the disk.  The
 > >	location overwritten is in the block after the one actually
 > >	belonging to the nextboot.conf file.
 > >
 > >	This problem is likely to be caused by an off-by-one bug in
 > >	the stand-alone FS access library used by loader(8).
 > 
 > You could try the following (I haven't tested it), but it's pretty
 > obvious how the bug happened if you compare bd_write() with the
 > bd_read() function that it was copied from. Looks like the author
 > of bd_write() was more interested in writing a little song in the
 > comments than writing to the correct part of the disk ;-)
 [...]
 
 I've been using nextboot with the patched loader lately and failed
 to notice any corruption.  The patch apparently works.  Thank you
 very much!  Are you going to commit it now?
 
 -- 
 Yar


More information about the freebsd-bugs mailing list