Re: Netscape and -current
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
Re: Netscape and -current
On Wed, 24 Nov 1999, Bruce Evans wrote: 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. Hmm... 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 I don't see how this fixes things, other than hiding it. Since the i386 memory model we use maps kernel and user memory all at the same time, this code is reading directly from user space memory, right? If this is the case, wouldn't a copyin() be the proper thing to do? At least doing the useracc() would be better than doing nothing, wouldn't it? 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 -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / [EMAIL PROTECTED]`--' To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
On Tue, 23 Nov 1999, Peter Wemm wrote: Brian Fundakowski Feldman wrote: Forget anything I said about KAME being the strong possibility :) As soon as peter noted what commit it could have to do with, I figured it out and fixed it; after testing, I committed it. Be happy :) Your fix suffers from exactly the same problem.. Suppose down the track that ucontext_t becomes smaller than 'struct sigocontext' ? You're then failing what would have worked. The check against sizeof osigcontext should not be fatal. That will not happen, though. Your proposal suffers from a very similar problem. Okay, let's assume that ucontext_t is _smaller_ than a struct osigcontext. If it fails the "osigcontext size test", it won't go to osigreturn, fine. BUT, it continues on, and is taken as a valid ucontext_t instead of an EINVAL osigcontext. Do you see where the problem is with this approach? Since the revision I committed went under an assumption that's alway going to be true, and even if it weren't, it would be updated to match the world anyway, I don't see the problem. Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / [EMAIL PROTECTED]`--' To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
RE: Netscape and -current
The same here. CURRENT updated and built on Sunday causes native FreeBSD Netscape to lock up. Linux Netscape still works fine. On 22-Nov-99 Jean-Marc Zucconi wrote: This happens with a kernel/world from today: netscape is unusable. Most of the time it freezes after a few seconds. Here is the tail of kdump: 484 communicator-4.7 RET select 0 484 communicator-4.7 CALL old.sigprocmask(0x1,0) 484 communicator-4.7 RET old.sigprocmask 0 484 communicator-4.7 CALL gettimeofday(0xbfbfb874,0) 484 communicator-4.7 RET gettimeofday 0 484 communicator-4.7 CALL old.sigprocmask(0x3,0) 484 communicator-4.7 RET old.sigprocmask 0 484 communicator-4.7 CALL old.sigprocmask(0x1,0x2000) 484 communicator-4.7 RET old.sigprocmask 0 484 communicator-4.7 CALL select(0xa,0x50011f48,0,0x50011f08,0x50011efc) 484 communicator-4.7 RET select 0 484 communicator-4.7 CALL gettimeofday(0x50011dac,0) 484 communicator-4.7 RET gettimeofday 0 484 communicator-4.7 CALL old.sigprocmask(0x3,0) 484 communicator-4.7 RET old.sigprocmask 8192/0x2000 484 communicator-4.7 CALL gettimeofday(0x50011f60,0) 484 communicator-4.7 RET gettimeofday 0 484 communicator-4.7 PSIG SIGALRM caught handler=0x8fea40 mask=0x0 code=0x0 484 communicator-4.7 CALL sigreturn(0x50011ed4) 484 communicator-4.7 RET sigreturn -1 errno 14 Bad address Any idea? Jean-Marc -- Jean-Marc ZucconiPGP Key: finger [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message -- E-Mail: Alexander N. Kabaev [EMAIL PROTECTED] Date: 22-Nov-99 Time: 09:28:45 -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
RE: Netscape and -current
On Mon, 22 Nov 1999, Brian Fundakowski Feldman wrote: On Mon, 22 Nov 1999, Alexander N. Kabaev wrote: The same here. CURRENT updated and built on Sunday causes native FreeBSD Netscape to lock up. Linux Netscape still works fine. Happens here, too. Can someone with a machine to spare try the following: Working on this now. I presume I can just build a kernel, since the machine I am trying to upgrade form -STABLE to CURRENT does this. David Scheidt To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
On 22-Nov-99 Steve Kargl wrote: FreeBSD 4.0-CURRENT #1: Mon Nov 15 09:52:45 PST 1999 [EMAIL PROTECTED]:/usr/src/sys/compile/TROUTMASK netscape (for FBSD) works fine. I have -current as of 19-Nov-99 and Netscape works fine (well as well at it ever does..) --- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
On Tue, 23 Nov 1999, Daniel O'Connor wrote: On 22-Nov-99 Steve Kargl wrote: FreeBSD 4.0-CURRENT #1: Mon Nov 15 09:52:45 PST 1999 [EMAIL PROTECTED]:/usr/src/sys/compile/TROUTMASK netscape (for FBSD) works fine. I have -current as of 19-Nov-99 and Netscape works fine (well as well at it ever does..) I'm pretty sure that my guess of KAME is correct, as evidenced by times of working and non-working kernels. But what do we do with that not-so-wild guess? --- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / [EMAIL PROTECTED]`--' To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
"Daniel O'Connor" wrote: On 22-Nov-99 Steve Kargl wrote: FreeBSD 4.0-CURRENT #1: Mon Nov 15 09:52:45 PST 1999 [EMAIL PROTECTED]:/usr/src/sys/compile/TROUTMASK netscape (for FBSD) works fine. I have -current as of 19-Nov-99 and Netscape works fine (well as well at it ever does..) I'd be curious to know if this fixes it on a -current kernel (after rev 1.377 of i386/machdep.c) Index: machdep.c === RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.377 diff -u -r1.377 machdep.c --- machdep.c 1999/11/21 14:46:43 1.377 +++ machdep.c 1999/11/23 03:40:49 @@ -871,14 +871,19 @@ { struct trapframe *regs; ucontext_t *ucp; + struct osigcontext *scp; int cs, eflags; ucp = uap-sigcntxp; + scp = (struct osigcontext *)ucp; + + if (useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ)) { + if (scp-sigcntxp-sc_trapno == 0x01d516) + return osigreturn(p, (struct osigreturn_args *)uap); + } + 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; eflags = ucp-uc_mcontext.mc_eflags; The problem is that the useracc was moved earlier, and is being done on a larger struct size before we know if it's the right struct or not. My suggested change is to test for only sizeof osigcontext until we know it's the larger (?) ucontext_t. Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
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. Thanks! Testing and committing a fix. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / [EMAIL PROTECTED]`--' To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
On Tue, 23 Nov 1999, Peter Wemm wrote: I'm pretty sure it's this commit to i386/machdep.c: Good call! A tree checked out with -D 1999-11-21 14:47 won't run netscape. A kernel built with the same sources, except for 1.376 of i386/machdep.c will. David Scheidt === 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 === .. it's right in the area that's breaking netscape: 484 communicator-4.7 PSIG SIGALRM caught handler=0x8fea40 mask=0x0 code=0x0 484 communicator-4.7 CALL sigreturn(0x50011ed4) 484 communicator-4.7 RET sigreturn -1 errno 14 Bad address Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
On Tue, Nov 23, 1999 at 11:44:33AM +0800, Peter Wemm wrote: I'd be curious to know if this fixes it on a -current kernel (after rev 1.377 of i386/machdep.c) Yep, except this needs to come out: + scp = (struct osigcontext *)ucp; + + if (useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ)) { + if (scp-sigcntxp-sc_trapno == 0x01d516) ^^ And that does the trick. -- Christopher Masto Senior Network Monkey NetMonger Communications [EMAIL PROTECTED][EMAIL PROTECTED]http://www.netmonger.net Free yourself, free your machine, free the daemon -- http://www.freebsd.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
Forget anything I said about KAME being the strong possibility :) As soon as peter noted what commit it could have to do with, I figured it out and fixed it; after testing, I committed it. Be happy :) -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / [EMAIL PROTECTED]`--' To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Netscape and -current
Brian Fundakowski Feldman wrote: Forget anything I said about KAME being the strong possibility :) As soon as peter noted what commit it could have to do with, I figured it out and fixed it; after testing, I committed it. Be happy :) Your fix suffers from exactly the same problem.. Suppose down the track that ucontext_t becomes smaller than 'struct sigocontext' ? You're then failing what would have worked. The check against sizeof osigcontext should not be fatal. Index: machdep.c === RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.378 diff -u -r1.378 machdep.c --- machdep.c 1999/11/23 04:09:13 1.378 +++ machdep.c 1999/11/23 05:49:46 @@ -871,14 +871,16 @@ { struct trapframe *regs; ucontext_t *ucp; + struct osigcontext *scp; int cs, eflags; ucp = uap-sigcntxp; + scp = (struct osigcontext *)ucp; - if (!useracc((caddr_t)ucp, sizeof(struct osigcontext), VM_PROT_READ)) - return (EFAULT); - if (((struct osigcontext *)ucp)-sc_trapno == 0x01d516) - return (osigreturn(p, (struct osigreturn_args *)uap)); + if (useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ)) { + if (scp-sc_trapno == 0x01d516) + return osigreturn(p, (struct osigreturn_args *)uap); + } /* * Since ucp is not an osigcontext but a ucontext_t, we have to Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Netscape and -current
This happens with a kernel/world from today: netscape is unusable. Most of the time it freezes after a few seconds. Here is the tail of kdump: 484 communicator-4.7 RET select 0 484 communicator-4.7 CALL old.sigprocmask(0x1,0) 484 communicator-4.7 RET old.sigprocmask 0 484 communicator-4.7 CALL gettimeofday(0xbfbfb874,0) 484 communicator-4.7 RET gettimeofday 0 484 communicator-4.7 CALL old.sigprocmask(0x3,0) 484 communicator-4.7 RET old.sigprocmask 0 484 communicator-4.7 CALL old.sigprocmask(0x1,0x2000) 484 communicator-4.7 RET old.sigprocmask 0 484 communicator-4.7 CALL select(0xa,0x50011f48,0,0x50011f08,0x50011efc) 484 communicator-4.7 RET select 0 484 communicator-4.7 CALL gettimeofday(0x50011dac,0) 484 communicator-4.7 RET gettimeofday 0 484 communicator-4.7 CALL old.sigprocmask(0x3,0) 484 communicator-4.7 RET old.sigprocmask 8192/0x2000 484 communicator-4.7 CALL gettimeofday(0x50011f60,0) 484 communicator-4.7 RET gettimeofday 0 484 communicator-4.7 PSIG SIGALRM caught handler=0x8fea40 mask=0x0 code=0x0 484 communicator-4.7 CALL sigreturn(0x50011ed4) 484 communicator-4.7 RET sigreturn -1 errno 14 Bad address Any idea? Jean-Marc -- Jean-Marc ZucconiPGP Key: finger [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message