]> git.hungrycats.org Git - linux/commitdiff
[PATCH] uml: let page faults always be delivered immediately
authorJeff Dike <jdike@addtoit.com>
Fri, 17 Sep 2004 05:11:55 +0000 (22:11 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 17 Sep 2004 05:11:55 +0000 (22:11 -0700)
This allows page faults to be delivered when they happen.  Without this, it
can happen that a page fault will occur when SIGSEGV is disabled, and the
host will then just kill UML because it can't invoke the handler.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/kernel/process.c
arch/um/kernel/tt/trap_user.c

index 4db4d89b85d6c8515f0c028cbb0b3b8c740fb90a..41c66d4b0877b88a81e8a19f042d4579369a360c 100644 (file)
@@ -57,11 +57,7 @@ void init_new_thread_signals(int altstack)
 {
        int flags = altstack ? SA_ONSTACK : 0;
 
-       /* NODEFER is set here because SEGV isn't turned back on when the
-        * handler is ready to receive signals.  This causes any segfault
-        * during a copy_user to kill the process because the fault is blocked.
-        */
-       set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags | SA_NODEFER,
+       set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
        set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags, 
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
index 7a6dbf5f90e1499fcdef4e54ba492fc6db2c1b11..693f506633e64f8b7f9be1ac480679c0fe3e2653 100644 (file)
@@ -23,6 +23,13 @@ void sig_handler_common_tt(int sig, void *sc_ptr)
 
        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);
+
        r = &TASK_REGS(get_current())->tt;
        save_regs = *r;
        is_user = user_context(SC_SP(sc));