svn commit: r197491 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/part

Marcel Moolenaar marcel at FreeBSD.org
Fri Sep 25 17:48:30 UTC 2009


Author: marcel
Date: Fri Sep 25 17:48:30 2009
New Revision: 197491
URL: http://svn.freebsd.org/changeset/base/197491

Log:
  MFC rev 197449:
  Don't create more partitions than can fit in the table by checking
  that the index is within bounds.
  
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/part/g_part.c

Modified: stable/8/sys/geom/part/g_part.c
==============================================================================
--- stable/8/sys/geom/part/g_part.c	Fri Sep 25 17:08:51 2009	(r197490)
+++ stable/8/sys/geom/part/g_part.c	Fri Sep 25 17:48:30 2009	(r197491)
@@ -480,6 +480,10 @@ g_part_ctl_add(struct gctl_req *req, str
 		gctl_error(req, "%d index '%d'", EEXIST, gpp->gpp_index);
 		return (EEXIST);
 	}
+	if (index > table->gpt_entries) {
+		gctl_error(req, "%d index '%d'", ENOSPC, index);
+		return (ENOSPC);
+	}
 
 	entry = (delent == NULL) ? g_malloc(table->gpt_scheme->gps_entrysz,
 	    M_WAITOK | M_ZERO) : delent;


More information about the svn-src-stable mailing list