Moved useracc() to top of sigreturn as to avoid panic

caused by invalid arguments to rutine.

Reviewed by:	marcel, phk
This commit is contained in:
Peter Holm 1999-11-21 14:46:43 +00:00
parent da654d9070
commit 8feb5d575d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53504
2 changed files with 8 additions and 8 deletions

View File

@ -873,16 +873,16 @@ sigreturn(p, uap)
ucontext_t *ucp;
int cs, eflags;
ucp = uap->sigcntxp;
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
return(EFAULT);
if (((struct osigcontext *)uap->sigcntxp)->sc_trapno == 0x01d516)
return osigreturn(p, (struct osigreturn_args *)uap);
regs = p->p_md.md_regs;
ucp = uap->sigcntxp;
eflags = ucp->uc_mcontext.mc_eflags;
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
return(EFAULT);
if (eflags & PSL_VM) {
struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
struct vm86_kernel *vm86;

View File

@ -873,16 +873,16 @@ sigreturn(p, uap)
ucontext_t *ucp;
int cs, eflags;
ucp = uap->sigcntxp;
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
return(EFAULT);
if (((struct osigcontext *)uap->sigcntxp)->sc_trapno == 0x01d516)
return osigreturn(p, (struct osigreturn_args *)uap);
regs = p->p_md.md_regs;
ucp = uap->sigcntxp;
eflags = ucp->uc_mcontext.mc_eflags;
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
return(EFAULT);
if (eflags & PSL_VM) {
struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
struct vm86_kernel *vm86;