From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] 2.6.8-rc4-mm1 - UML fixes
Date: Thu, 12 Aug 2004 00:15:32 -0400 [thread overview]
Message-ID: <200408120415.i7C4FWJd010494@ccure.user-mode-linux.org> (raw)
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
Jeff
Index: 2.6.8-rc4-mm1/arch/um/kernel/process.c
===================================================================
--- 2.6.8-rc4-mm1.orig/arch/um/kernel/process.c 2004-08-11 22:44:42.000000000 -0400
+++ 2.6.8-rc4-mm1/arch/um/kernel/process.c 2004-08-11 23:09:44.000000000 -0400
@@ -124,10 +124,14 @@
/* 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: 2.6.8-rc4-mm1/arch/um/kernel/process_kern.c
===================================================================
--- 2.6.8-rc4-mm1.orig/arch/um/kernel/process_kern.c 2004-08-11 23:03:14.000000000 -0400
+++ 2.6.8-rc4-mm1/arch/um/kernel/process_kern.c 2004-08-11 23:09:44.000000000 -0400
@@ -167,7 +167,7 @@
{
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: 2.6.8-rc4-mm1/arch/um/kernel/trap_kern.c
===================================================================
--- 2.6.8-rc4-mm1.orig/arch/um/kernel/trap_kern.c 2004-08-11 22:44:42.000000000 -0400
+++ 2.6.8-rc4-mm1/arch/um/kernel/trap_kern.c 2004-08-11 23:09:44.000000000 -0400
@@ -54,8 +54,6 @@
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: 2.6.8-rc4-mm1/arch/um/kernel/tt/mem.c
===================================================================
--- 2.6.8-rc4-mm1.orig/arch/um/kernel/tt/mem.c 2004-08-11 22:44:42.000000000 -0400
+++ 2.6.8-rc4-mm1/arch/um/kernel/tt/mem.c 2004-08-11 23:09:44.000000000 -0400
@@ -18,7 +18,7 @@
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: 2.6.8-rc4-mm1/arch/um/kernel/tt/process_kern.c
===================================================================
--- 2.6.8-rc4-mm1.orig/arch/um/kernel/tt/process_kern.c 2004-08-11 22:44:42.000000000 -0400
+++ 2.6.8-rc4-mm1/arch/um/kernel/tt/process_kern.c 2004-08-11 23:09:44.000000000 -0400
@@ -412,7 +412,7 @@
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);
next reply other threads:[~2004-08-12 3:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-12 4:15 Jeff Dike [this message]
2004-08-12 3:30 ` William Lee Irwin III
2004-08-12 5:41 ` Jeff Dike
2004-08-12 6:50 ` William Lee Irwin III
2004-08-12 16:56 ` Jeff Dike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200408120415.i7C4FWJd010494@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome