linux-um archives
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: torvalds@osdl.org, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH 12/12] UML - x86_64 fixes
Date: Fri, 06 May 2005 18:49:38 -0400	[thread overview]
Message-ID: <200505062249.j46MncJb010495@ccure.user-mode-linux.org> (raw)

This fixes some x86_64 bugs -
    maybe_map returns -1 on error instead of 0, which is interpretted as
physical address 0
    removed an include of ipc.h, which isn't needed
    fixed the calculation of signal frame location
    the signal delivery code is now immune to the stack expansion check
    added a missing include

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.12-rc3-mm/arch/um/kernel/skas/uaccess.c
===================================================================
--- linux-2.6.12-rc3-mm.orig/arch/um/kernel/skas/uaccess.c	2005-05-05 12:19:04.000000000 -0400
+++ linux-2.6.12-rc3-mm/arch/um/kernel/skas/uaccess.c	2005-05-05 12:43:02.000000000 -0400
@@ -29,9 +29,12 @@
 	if(IS_ERR(phys) || (is_write && !pte_write(pte))){
 		err = handle_page_fault(virt, 0, is_write, 1, &dummy_code);
 		if(err)
-			return(0);
+			return(-1UL);
 		phys = um_virt_to_phys(current, virt, NULL);
 	}
+        if(IS_ERR(phys))
+                phys = (void *) -1;
+
 	return((unsigned long) phys);
 }
 
@@ -42,7 +45,7 @@
 	int n;
 
 	addr = maybe_map(addr, is_write);
-	if(addr == -1)
+	if(addr == -1UL)
 		return(-1);
 
 	page = phys_to_page(addr);
Index: linux-2.6.12-rc3-mm/arch/um/kernel/syscall_kern.c
===================================================================
--- linux-2.6.12-rc3-mm.orig/arch/um/kernel/syscall_kern.c	2005-05-02 14:47:52.000000000 -0400
+++ linux-2.6.12-rc3-mm/arch/um/kernel/syscall_kern.c	2005-05-05 12:43:02.000000000 -0400
@@ -17,7 +17,6 @@
 #include "linux/utime.h"
 #include "asm/mman.h"
 #include "asm/uaccess.h"
-#include "asm/ipc.h"
 #include "kern_util.h"
 #include "user_util.h"
 #include "sysdep/syscalls.h"
Index: linux-2.6.12-rc3-mm/arch/um/kernel/trap_kern.c
===================================================================
--- linux-2.6.12-rc3-mm.orig/arch/um/kernel/trap_kern.c	2005-05-05 12:19:04.000000000 -0400
+++ linux-2.6.12-rc3-mm/arch/um/kernel/trap_kern.c	2005-05-05 12:43:02.000000000 -0400
@@ -48,7 +48,7 @@
 		goto good_area;
 	else if(!(vma->vm_flags & VM_GROWSDOWN)) 
 		goto out;
-	else if(!ARCH_IS_STACKGROW(address))
+	else if(is_user && !ARCH_IS_STACKGROW(address))
 		goto out;
 	else if(expand_stack(vma, address)) 
 		goto out;
Index: linux-2.6.12-rc3-mm/arch/um/sys-x86_64/signal.c
===================================================================
--- linux-2.6.12-rc3-mm.orig/arch/um/sys-x86_64/signal.c	2005-05-05 12:19:04.000000000 -0400
+++ linux-2.6.12-rc3-mm/arch/um/sys-x86_64/signal.c	2005-05-05 12:43:02.000000000 -0400
@@ -168,7 +168,7 @@
 
 	frame = (struct rt_sigframe __user *)
 		round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
-	frame -= 128;
+	((unsigned char *) frame) -= 128;
 
 	if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
 		goto out;
Index: linux-2.6.12-rc3-mm/arch/um/sys-x86_64/syscalls.c
===================================================================
--- linux-2.6.12-rc3-mm.orig/arch/um/sys-x86_64/syscalls.c	2005-05-05 12:19:04.000000000 -0400
+++ linux-2.6.12-rc3-mm/arch/um/sys-x86_64/syscalls.c	2005-05-05 12:43:02.000000000 -0400
@@ -44,6 +44,8 @@
 #ifdef CONFIG_MODE_SKAS
 extern int userspace_pid[];
 
+#include "skas_ptrace.h"
+
 long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount)
 {
 	struct ptrace_ldt ldt;



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

                 reply	other threads:[~2005-05-06 22:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200505062249.j46MncJb010495@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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