On Tue, 23 Nov 1999, Peter Wemm wrote:

> I'm pretty sure it's this commit to i386/machdep.c:
> ===
> revision 1.377
> date: 1999/11/21 14:46:43;  author: pho;  state: Exp;  lines: +5 -5
> Moved useracc() to top of sigreturn as to avoid panic
> caused by invalid arguments to rutine.
> 
> Reviewed by:    marcel, phk
> ===

Hmm.  My netscape works, but I didn't use merge that commit.  I had already
inadvertly fixed the bug in another way while cleaning up.

Indeed, the proplem is checking the new context before checking that the
context is actually new.

Here is my version.

int
sigreturn(p, uap)
        struct proc *p;
        struct sigreturn_args /* {
                ucontext_t *ucp;
        } */ *uap;
{
        struct trapframe *regs;
        ucontext_t *ucp;
        int cs, eflags;

#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
        if (((struct osigcontext *)uap->sigcntxp)->sc_trapno == 0x01d516)
                return (osigreturn(p, (struct osigreturn_args *)uap));
#endif

        ucp = uap-> /* ucp */ sigcntxp;
        if (!useracc((caddr_t)ucp, sizeof(*ucp), VM_PROT_READ))
                return (EFAULT);
        eflags = ucp->uc_mcontext.mc_eflags;
        regs = p->p_md.md_regs;

Bruce



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to