From owner-freebsd-current Sun Dec 15 12:40:35 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9562D37B401; Sun, 15 Dec 2002 12:40:33 -0800 (PST) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE27C43EC2; Sun, 15 Dec 2002 12:40:32 -0800 (PST) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc02.attbi.com (sccrmhc02) with ESMTP id <2002121520403100200eeim0e>; Sun, 15 Dec 2002 20:40:31 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA03603; Sun, 15 Dec 2002 12:40:30 -0800 (PST) Date: Sun, 15 Dec 2002 12:40:28 -0800 (PST) From: Julian Elischer To: Nate Lawson Cc: FreeBSD current users , re@freebsd.org Subject: Re: 5.0 dangerous dumps (showstopper?) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ok. so On Fri, 13 Dec 2002, Julian Elischer wrote: > > > On Fri, 13 Dec 2002, Nate Lawson wrote: > > > On Fri, 13 Dec 2002, Julian Elischer wrote: > > > On Fri, 13 Dec 2002, Peter Wemm wrote: > > > > Julian Elischer wrote: > > > > > 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; > > > > > } > > > > Assuming I can make similar patches for the other architectures, should this be committed? how does it make its way to RELENG_5_0? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message