svn commit: r322799 - head/sys/amd64/amd64

Konstantin Belousov kib at FreeBSD.org
Tue Aug 22 18:15:48 UTC 2017


Author: kib
Date: Tue Aug 22 18:15:47 2017
New Revision: 322799
URL: https://svnweb.freebsd.org/changeset/base/322799

Log:
  Ensure that fs/gs bases are stored in pcb before copying the pcb for
  new process or thread.
  
  Reported and tested by:	ae, dhw
  Sponsored by:	The FreeBSD Foundation
  MFC after:	20 days

Modified:
  head/sys/amd64/amd64/vm_machdep.c

Modified: head/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- head/sys/amd64/amd64/vm_machdep.c	Tue Aug 22 17:57:34 2017	(r322798)
+++ head/sys/amd64/amd64/vm_machdep.c	Tue Aug 22 18:15:47 2017	(r322799)
@@ -172,6 +172,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t
 
 	/* Ensure that td1's pcb is up to date. */
 	fpuexit(td1);
+	update_pcb_bases(td1->td_pcb);
 
 	/* Point the pcb to the top of the stack */
 	pcb2 = get_pcb_td(td2);
@@ -433,6 +434,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0)
 	 * Those not loaded individually below get their default
 	 * values here.
 	 */
+	update_pcb_bases(td0->td_pcb);
 	bcopy(td0->td_pcb, pcb2, sizeof(*pcb2));
 	clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE |
 	    PCB_KERNFPU);


More information about the svn-src-head mailing list