lkml.org 
[lkml]   [2004]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Bug report for UML in latest Linus 2.6-BK repository.
Date
From
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(&current->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(&current->sighand->siglock);
- copy_from_user(&current->blocked.sig[0], mask,
- sizeof(current->blocked.sig[0]));
- copy_from_user(&current->blocked.sig[1], mask, sig_size);
- sigdelsetmask(&current->blocked, ~_BLOCKABLE);
+ current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
- copy_sc_from_user(&current->thread.regs, sc);
+
+ if(copy_sc_from_user(&current->thread.regs, sc))
+ goto segfault;
+
return(PT_REGS_SYSCALL_RET(&current->thread.regs));
+
+ segfault:
+ force_sig(SIGSEGV, current);
+ return 0;
}

long sys_rt_sigreturn(struct pt_regs regs)
{
unsigned long __user sp = PT_REGS_SP(&current->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(&current->sighand->siglock);
- copy_from_user(&current->blocked, &uc->uc_sigmask, sig_size);
- sigdelsetmask(&current->blocked, ~_BLOCKABLE);
+ current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
- copy_sc_from_user(&current->thread.regs, &uc->uc_mcontext);
+
+ if(copy_sc_from_user(&current->thread.regs, &uc->uc_mcontext))
+ goto segfault;
+
return(PT_REGS_SYSCALL_RET(&current->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/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.081 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site