Messages in this thread Patch in this message | | | Subject | Re: Bug report for UML in latest Linus 2.6-BK repository. | Date | Wed, 17 Nov 2004 15:56:09 -0500 | From | Jeff Dike <> |
| |
aia21@cam.ac.uk said: > I get millions of these on the UML guest as soon as I start UML > (.config is below), notably HIGHMEM is not enabled in the .config. > They only stop when I shutdown.
The patch below fixes those for me.
Jeff
Index: 2.6.9/arch/um/sys-i386/signal.c =================================================================== --- 2.6.9.orig/arch/um/sys-i386/signal.c 2004-11-16 23:19:45.000000000 -0500 +++ 2.6.9/arch/um/sys-i386/signal.c 2004-11-16 23:27:54.000000000 -0500 @@ -305,35 +305,58 @@ { unsigned long __user sp = PT_REGS_SP(¤t->thread.regs); struct sigframe __user *frame = (struct sigframe *)(sp - 8); + sigset_t set; struct sigcontext __user *sc = &frame->sc; unsigned long __user *mask = &sc->oldmask; int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long); + if(copy_from_user(&set.sig[0], mask, sizeof(&set.sig[0])) || + copy_from_user(&set.sig[1], mask, sig_size)) + goto segfault; + + sigdelsetmask(&set, ~_BLOCKABLE); + spin_lock_irq(¤t->sighand->siglock); - copy_from_user(¤t->blocked.sig[0], mask, - sizeof(current->blocked.sig[0])); - copy_from_user(¤t->blocked.sig[1], mask, sig_size); - sigdelsetmask(¤t->blocked, ~_BLOCKABLE); + current->blocked = set; recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - copy_sc_from_user(¤t->thread.regs, sc); + + if(copy_sc_from_user(¤t->thread.regs, sc)) + goto segfault; + return(PT_REGS_SYSCALL_RET(¤t->thread.regs)); + + segfault: + force_sig(SIGSEGV, current); + return 0; } long sys_rt_sigreturn(struct pt_regs regs) { unsigned long __user sp = PT_REGS_SP(¤t->thread.regs); struct rt_sigframe __user *frame = (struct rt_sigframe *) (sp - 4); + sigset_t set; struct ucontext __user *uc = &frame->uc; int sig_size = _NSIG_WORDS * sizeof(unsigned long); + if(copy_from_user(&set, &uc->uc_sigmask, sig_size)) + goto segfault; + + sigdelsetmask(&set, ~_BLOCKABLE); + spin_lock_irq(¤t->sighand->siglock); - copy_from_user(¤t->blocked, &uc->uc_sigmask, sig_size); - sigdelsetmask(¤t->blocked, ~_BLOCKABLE); + current->blocked = set; recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext); + + if(copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext)) + goto segfault; + return(PT_REGS_SYSCALL_RET(¤t->thread.regs)); + + segfault: + force_sig(SIGSEGV, current); + return 0; } /* - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |