Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2008 18:52:38 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184136 - head/sys/geom
Message-ID:  <200810211852.m9LIqcrf006190@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Oct 21 18:52:38 2008
New Revision: 184136
URL: http://svn.freebsd.org/changeset/base/184136

Log:
  Do not overflow crashdumpmap.
  
  Reported and tested by:	pho
  Reviewed by:	jhb
  MFC after:	1 week

Modified:
  head/sys/geom/geom_disk.c

Modified: head/sys/geom/geom_disk.c
==============================================================================
--- head/sys/geom/geom_disk.c	Tue Oct 21 18:51:55 2008	(r184135)
+++ head/sys/geom/geom_disk.c	Tue Oct 21 18:52:38 2008	(r184136)
@@ -179,7 +179,7 @@ g_disk_kerneldump(struct bio *bp, struct
 	di.dumper = dp->d_dump;
 	di.priv = dp;
 	di.blocksize = dp->d_sectorsize;
-	di.maxiosize = dp->d_maxsize;
+	di.maxiosize = min(dp->d_maxsize, MAXDUMPPGS * PAGE_SIZE);
 	di.mediaoffset = gkd->offset;
 	if ((gkd->offset + gkd->length) > dp->d_mediasize)
 		gkd->length = dp->d_mediasize - gkd->offset;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810211852.m9LIqcrf006190>