svn commit: r199110 - stable/8/sys/powerpc/aim

Nathan Whitehorn nwhitehorn at FreeBSD.org
Mon Nov 9 21:30:45 UTC 2009


Author: nwhitehorn
Date: Mon Nov  9 21:30:45 2009
New Revision: 199110
URL: http://svn.freebsd.org/changeset/base/199110

Log:
  Insta-MFC of r199084,199108:
     Increase the size of the OFW translations buffer to handle G5 systems
     that use many translation regions in firmware, and add bounds checking
     to prevent buffer overflows in case even the new value is exceeded.
  
  Short MFC requested by re since the problem this fixes breaks CD boot on
  most G5 systems, making them uninstallable.
  
  Reported by:	Jacob Lambert
  Approved by:	re (kensmith,kib)
  Requested by:	re

Modified:
  stable/8/sys/powerpc/aim/mmu_oea64.c
Directory Properties:
  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)

Modified: stable/8/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- stable/8/sys/powerpc/aim/mmu_oea64.c	Mon Nov  9 21:28:07 2009	(r199109)
+++ stable/8/sys/powerpc/aim/mmu_oea64.c	Mon Nov  9 21:30:45 2009	(r199110)
@@ -270,7 +270,7 @@ static struct	mem_region *pregions;
 extern u_int	phys_avail_count;
 extern int	regions_sz, pregions_sz;
 extern int	ofw_real_mode;
-static struct	ofw_map translations[64];
+static struct	ofw_map translations[96];
 
 extern struct pmap ofw_pmap;
 
@@ -896,6 +896,9 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 		panic("moea64_bootstrap: can't get mmu package");
 	    if ((sz = OF_getproplen(mmu, "translations")) == -1)
 		panic("moea64_bootstrap: can't get ofw translation count");
+	    if (sz > sizeof(translations))
+		panic("moea64_bootstrap: too many ofw translations (%d)",
+		      sz/sizeof(*translations));
 
 	    bzero(translations, sz);
 	    if (OF_getprop(mmu, "translations", translations, sz) == -1)


More information about the svn-src-stable-8 mailing list