From owner-cvs-all Sat Oct 5 7: 5:54 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99D4837B404; Sat, 5 Oct 2002 07:05:53 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6631543E6A; Sat, 5 Oct 2002 07:05:51 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA03434; Sun, 6 Oct 2002 00:05:49 +1000 Date: Sun, 6 Oct 2002 00:15:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Brian Somers Cc: cvs-committers@FreeBSD.org, Subject: Re: cvs commit: src/sys/kern subr_disk.c In-Reply-To: <200210051124.g95BOMk2092338@freefall.freebsd.org> Message-ID: <20021005235134.J12119-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 5 Oct 2002, Brian Somers wrote: > brian 2002/10/05 04:24:22 PDT > > Modified files: > sys/kern subr_disk.c > Log: > If dsgetlabel() returns a label with a size of zero in diskdumpconf(), > treat it as an invalid partition. > > This fixes a bug where ``dumpon '' will configure the dump > device at a random offset on the disk if isn't a valid > partition. This seems to only unbreak the case where the partition size is 0. At least the i386 dumpsys() has no bounds checking at the partition level. It clobbers sectors outside of the partition starting at the non-random offset dumplo given by: dumplo = di->mediaoffset + di->mediasize - Maxmem * (off_t)PAGE_SIZE; dumplo -= sizeof kdh * 2; except in the following cases: - if di_mediasize is actually large enough to hold the data (di_mediasize >= Maxmem * (off_t)PAGE_SIZE + sizeof(kdh) * 2 + ) - if di_mediasize is 0 (or just small), then dumplo is negative and the disk driver's or hardware's bounds checking (of physical sector numbers) should prevent problems. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message