Fix stack location for VM86 processes in the !sigaltstack case.
I doubt it makes much sense to use the VM's stack for this, but the old code was doubtless wrong because it potentially overwrote random user memory. (It might be a good idea to use the process' pre-vm86()-call stack, but atm the infrastructure for this is missing.)
This commit is contained in:
parent
4257f06ff2
commit
e8d0979bed
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.528 2003/08/07 16:27:54 agc Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.529 2003/08/11 14:09:18 drochner Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -72,7 +72,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.528 2003/08/07 16:27:54 agc Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.529 2003/08/11 14:09:18 drochner Exp $");
|
||||
|
||||
#include "opt_cputype.h"
|
||||
#include "opt_ddb.h"
|
||||
@ -617,8 +617,14 @@ sendsig(sig, mask, code)
|
||||
if (onstack)
|
||||
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
|
||||
p->p_sigctx.ps_sigstk.ss_size);
|
||||
else
|
||||
fp = (struct sigframe *)tf->tf_esp;
|
||||
else {
|
||||
#ifdef VM86
|
||||
if (tf->tf_eflags & PSL_VM)
|
||||
fp = (struct sigframe *)(tf->tf_esp + (tf->tf_ss << 4));
|
||||
else
|
||||
#endif
|
||||
fp = (struct sigframe *)tf->tf_esp;
|
||||
}
|
||||
fp--;
|
||||
|
||||
/* Build stack frame for signal trampoline. */
|
||||
|
Loading…
Reference in New Issue
Block a user