svn commit: r191455 - head/sys/powerpc/aim

Rafal Jaworowski raj at FreeBSD.org
Fri Apr 24 08:57:54 UTC 2009


Author: raj
Date: Fri Apr 24 08:57:54 2009
New Revision: 191455
URL: http://svn.freebsd.org/changeset/base/191455

Log:
  Zero PCB during early AIM PowerPC init.
  
  When memory is not zero'ed by firmware, uninitialized PCB can have bogus
  contents, which appear as a saved onfault condition, Altivec context to
  restore etc. and lead to corruption/crashes. This commit fixes such issues.
  
  Submitted by:	Michal Mazur arg ! semihalf dot com
  Tested by:	Andreas Tobler andreast-list ! fgznet dot ch

Modified:
  head/sys/powerpc/aim/machdep.c

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Fri Apr 24 06:44:58 2009	(r191454)
+++ head/sys/powerpc/aim/machdep.c	Fri Apr 24 08:57:54 2009	(r191455)
@@ -505,6 +505,7 @@ powerpc_init(u_int startkernel, u_int en
 	thread0.td_pcb = (struct pcb *)
 	    ((thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE -
 	    sizeof(struct pcb)) & ~15);
+	bzero((void *)thread0.td_pcb, sizeof(struct pcb));
 	pc->pc_curpcb = thread0.td_pcb;
 
 	/* Initialise the message buffer. */


More information about the svn-src-all mailing list