summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2003-05-16 01:10:33 +0000
committertmm <tmm@FreeBSD.org>2003-05-16 01:10:33 +0000
commit19a94ea3a38a44ec60c6ebec5f3a8d99d066c45f (patch)
treef517e59abbeb865a8aa866648f8af14b8594c796
parentfa59fd22ea459419f0ca4610aa7c8bedce7594ce (diff)
downloadFreeBSD-src-19a94ea3a38a44ec60c6ebec5f3a8d99d066c45f.zip
FreeBSD-src-19a94ea3a38a44ec60c6ebec5f3a8d99d066c45f.tar.gz
In cpu_fork(), initialize pcb_psl for the new process to PSL_KERNEL,
instead of taking the (userland) eflags from the trap frame and masking out PSL_I. There is no need to inherit any flags from the forking process; the old method however can cause flags set in userland for the forking process to be bogusly set in kernel mode when the newly forked process runs for the first time (in particular PSL_T, which is set for userland when the process is single-stepped; this would cause trace traps in kernel mode). Approved by: re (jhb)
-rw-r--r--sys/i386/i386/vm_machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index bdb189f..27f33b8 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -181,7 +181,7 @@ cpu_fork(td1, p2, td2, flags)
pcb2->pcb_esp = (int)td2->td_frame - sizeof(void *);
pcb2->pcb_ebx = (int)td2; /* fork_trampoline argument */
pcb2->pcb_eip = (int)fork_trampoline;
- pcb2->pcb_psl = td2->td_frame->tf_eflags & ~PSL_I; /* ints disabled */
+ pcb2->pcb_psl = PSL_KERNEL; /* ints disabled */
pcb2->pcb_gs = rgs();
/*-
* pcb2->pcb_dr*: cloned above.
OpenPOWER on IntegriCloud