Date: Tue, 22 Aug 2017 18:15:47 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322799 - head/sys/amd64/amd64 Message-ID: <201708221815.v7MIFlI2033719@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708221815.v7MIFlI2033719>