upgrade to fedora-2.6.12-1.1398.FC4 + vserver 2.0.rc7
[linux-2.6.git] / arch / um / kernel / tt / trap_user.c
index 81b911f..fc10861 100644 (file)
@@ -6,8 +6,8 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <signal.h>
-#include <asm/sigcontext.h>
 #include "sysdep/ptrace.h"
+#include "sysdep/sigcontext.h"
 #include "signal_user.h"
 #include "user_util.h"
 #include "kern_util.h"
@@ -21,15 +21,6 @@ void sig_handler_common_tt(int sig, void *sc_ptr)
        struct signal_info *info;
        int save_errno = errno, is_user;
 
-       unprotect_kernel_mem();
-
-       /* This is done because to allow SIGSEGV to be delivered inside a SEGV
-        * handler.  This can happen in copy_user, and if SEGV is disabled,
-        * the process will die.
-        */
-       if(sig == SIGSEGV)
-               change_sig(SIGSEGV, 1);
-
        /* This is done because to allow SIGSEGV to be delivered inside a SEGV
         * handler.  This can happen in copy_user, and if SEGV is disabled,
         * the process will die.
@@ -38,6 +29,11 @@ void sig_handler_common_tt(int sig, void *sc_ptr)
                change_sig(SIGSEGV, 1);
 
        r = &TASK_REGS(get_current())->tt;
+        if ( sig == SIGFPE || sig == SIGSEGV ||
+             sig == SIGBUS || sig == SIGILL ||
+             sig == SIGTRAP ) {
+                GET_FAULTINFO_FROM_SC(r->faultinfo, sc);
+        }
        save_regs = *r;
        is_user = user_context(SC_SP(sc));
        r->sc = sc;
@@ -56,7 +52,6 @@ void sig_handler_common_tt(int sig, void *sc_ptr)
        }
        *r = save_regs;
        errno = save_errno;
-       if(is_user) protect_kernel_mem();
 }
 
 /*