Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2011 12:53:15 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r228573 - in stable/8/sys: conf kern
Message-ID:  <201112161253.pBGCrF5C007553@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Fri Dec 16 12:53:15 2011
New Revision: 228573
URL: http://svn.freebsd.org/changeset/base/228573

Log:
  MFC: r228360
  
  Move cpu_set_upcall(newtd, td) up before the first call of
  thread_free(newtd).  This to avoid a possible page fault in
  cpu_thread_clean() as seen on amd64 with syscall fuzzing.

Modified:
  stable/8/sys/kern/kern_thr.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/conf/ldscript.mips.octeon1.32   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_thr.c
==============================================================================
--- stable/8/sys/kern/kern_thr.c	Fri Dec 16 12:42:02 2011	(r228572)
+++ stable/8/sys/kern/kern_thr.c	Fri Dec 16 12:53:15 2011	(r228573)
@@ -188,6 +188,8 @@ create_thread(struct thread *td, mcontex
 	if (newtd == NULL)
 		return (ENOMEM);
 
+	cpu_set_upcall(newtd, td);
+
 	/*
 	 * Try the copyout as soon as we allocate the td so we don't
 	 * have to tear things down in a failure case below.
@@ -215,8 +217,6 @@ create_thread(struct thread *td, mcontex
 	newtd->td_proc = td->td_proc;
 	newtd->td_ucred = crhold(td->td_ucred);
 
-	cpu_set_upcall(newtd, td);
-
 	if (ctx != NULL) { /* old way to set user context */
 		error = set_mcontext(newtd, ctx);
 		if (error != 0) {



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