Date: Fri, 13 Dec 2002 16:45:13 -0800 From: Peter Wemm <peter@wemm.org> To: Julian Elischer <julian@elischer.org> Cc: Dan Nelson <dnelson@allantgroup.com>, Nate Lawson <nate@root.org>, Kevin Oberman <oberman@es.net>, FreeBSD current users <current@FreeBSD.ORG>, re@freebsd.org Subject: Re: 5.0 showstopper Message-ID: <20021214004513.733AB2A7EA@canning.wemm.org> In-Reply-To: <Pine.BSF.4.21.0212131309480.9978-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer wrote:
> On Fri, 13 Dec 2002, Julian Elischer wrote:
> > On Fri, 13 Dec 2002, Dan Nelson wrote:
> >
> > > In the last episode (Dec 13), Julian Elischer said:
> > > > It's always been there. the question is
> > > > "Who has broken it?"
> >
> > I think this is a 5.0 showstopper. Having 5.0 overwrite your
> > Windows partition would be "poor" PR.
> > Having a quick look at it, it shouldn't be too hard for PHK
> > to fix it as he has all the correct parts currently "loaded"
> > into his head. Especially such things as making GEOM not allow writes
> > to -ve blocknumbers (as must have happenned for root to have been
> > overwritten).
>
>
> looking at the code in src/sys/i386/i386/dump_machdep.c,
>
> we see:
> 78 dumplo = di->mediaoffset + di->mediasize - Maxmem *
> (off_t)PAGE_SIZE;
> 79 dumplo -= sizeof kdh * 2;
> 80 i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh);
> 81 if (i)
> 82 printf("\nDump failed writing header (%d)\n", i);
> 83 dumplo += sizeof kdh;
> 84 i = 0;
>
> It looks like the following test should go after line 77
>
> if (di->mediasize < ((Maxmem * (off_t)PAGE_SIZE) +
> (sizeof kdh * 2) + (16*1024)) {
> /* 16K is an arbitrary buffer
> * in case the swap part is
> * the first part
> */
> printf("\nDump failed. Partition too small.\n");
> return;
> }
We used to force a 64K safety buffer for swapon, and I think we also did
64K for dump before the last MI dump code conversion. I'd feel a little
happier if you used 64K here instead of 16K.
Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021214004513.733AB2A7EA>
