From a93b6bf5e994178339792ae87d92d53ea68bde1b Mon Sep 17 00:00:00 2001 From: Thomas Moestl Date: Fri, 16 May 2003 01:10:33 +0000 Subject: [PATCH] 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) --- sys/i386/i386/vm_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index bdb189fa4dd1..27f33b81ff49 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.