]> git.hungrycats.org Git - linux/commitdiff
[PATCH] UML fixes
authorJeff Dike <jdike@addtoit.com>
Tue, 24 Aug 2004 04:18:53 +0000 (21:18 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 24 Aug 2004 04:18:53 +0000 (21:18 -0700)
The patch below fixes a few UML-specific bugs not related to the rest of the
kernel
a bogus error return and some formatting in the fork code
correct calculation of task.thread.kernel_stack
remove a bogus panic
a couple of fixes to allow UML to boot in the presence of exec-shield

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/kernel/process.c
arch/um/kernel/process_kern.c
arch/um/kernel/trap_kern.c
arch/um/kernel/tt/mem.c
arch/um/kernel/tt/process_kern.c

index d0ed604501d791f7d693c0f726c02bc77e7ec343..ff8f72736feca4b5ea45ccf15a46bcf40de82768 100644 (file)
@@ -124,10 +124,14 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
 
        /* Start the process and wait for it to kill itself */
        new_pid = clone(outer_tramp, (void *) sp, clone_flags, &arg);
-       if(new_pid < 0) return(-errno);
+       if(new_pid < 0)
+               return(new_pid);
+
        CATCH_EINTR(err = waitpid(new_pid, &status, 0));
-       if(err < 0) panic("Waiting for outer trampoline failed - errno = %d", 
-                         errno);
+       if(err < 0)
+               panic("Waiting for outer trampoline failed - errno = %d",
+                     errno);
+
        if(!WIFSIGNALED(status) || (WTERMSIG(status) != SIGKILL))
                panic("outer trampoline didn't exit with SIGKILL, "
                      "status = %d", status);
index 1eab0a315522470660b72a88bfd3d4d3f6ebbc0a..864a5b8293157ce77eaf55455e6a0a6307f2e154 100644 (file)
@@ -167,7 +167,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
 {
        p->thread = (struct thread_struct) INIT_THREAD;
        p->thread.kernel_stack = 
-               (unsigned long) p->thread_info + THREAD_SIZE;
+               (unsigned long) p->thread_info + 2 * PAGE_SIZE;
        return(CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr, 
                                clone_flags, sp, stack_top, p, regs));
 }
index 92bdb9a40a31ded71ce4879459c1c5ec2e399c7d..cba33ef6da5d8cdd101fe402831a848d9069ac49 100644 (file)
@@ -54,8 +54,6 @@ int handle_page_fault(unsigned long address, unsigned long ip,
        if(is_write && !(vma->vm_flags & VM_WRITE)) 
                goto out;
        page = address & PAGE_MASK;
-       if(address < (unsigned long) current_thread + 1024 && !is_user)
-               panic("Kernel stack overflow");
        pgd = pgd_offset(mm, page);
        pmd = pmd_offset(pgd, page);
        do {
index 0c39b266388995b040609a4da761fa8744dec0bf..34090b8d29836b5de05673bf0f1c5751b52e9696 100644 (file)
@@ -18,7 +18,7 @@ void before_mem_tt(unsigned long brk_start)
        if(!jail || debug)
                remap_data(UML_ROUND_DOWN(&_stext), UML_ROUND_UP(&_etext), 1);
        remap_data(UML_ROUND_DOWN(&_sdata), UML_ROUND_UP(&_edata), 1);
-       remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(brk_start), 1);
+       remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1);
 }
 
 #ifdef CONFIG_HOST_2G_2G
index 6059a9f01c669892cff34ac4c0b42ce959a6b9ed..4b4a1a1ab430b8ee6714d68bb23ce9dc8bdab363 100644 (file)
@@ -412,7 +412,7 @@ static void mprotect_kernel_mem(int w)
        protect_memory(start, end - start, 1, w, 1, 1);
 
        start = (unsigned long) UML_ROUND_DOWN(&__bss_start);
-       end = (unsigned long) UML_ROUND_UP(brk_start);
+       end = (unsigned long) UML_ROUND_UP(&_end);
        protect_memory(start, end - start, 1, w, 1, 1);
 
        mprotect_kernel_vm(w);