Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2012 18:27:24 +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-9@freebsd.org
Subject:   svn commit: r230466 - stable/9/sys/kern
Message-ID:  <201201221827.q0MIRO23087499@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Sun Jan 22 18:27:24 2012
New Revision: 230466
URL: http://svn.freebsd.org/changeset/base/230466

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/9/sys/kern/kern_thr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_thr.c
==============================================================================
--- stable/9/sys/kern/kern_thr.c	Sun Jan 22 15:44:20 2012	(r230465)
+++ stable/9/sys/kern/kern_thr.c	Sun Jan 22 18:27:24 2012	(r230466)
@@ -200,6 +200,8 @@ create_thread(struct thread *td, mcontex
 		goto fail;
 	}
 
+	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.
@@ -225,8 +227,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?201201221827.q0MIRO23087499>