Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] uml: x86_64 fixes

This fixes some x86_64 bugs -

- maybe_map returns -1 on error instead of 0, which is interpreted 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>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jeff Dike and committed by
Linus Torvalds
2d58cc9a 0f7e663d

+9 -5
+5 -2
arch/um/kernel/skas/uaccess.c
··· 29 29 if(IS_ERR(phys) || (is_write && !pte_write(pte))){ 30 30 err = handle_page_fault(virt, 0, is_write, 1, &dummy_code); 31 31 if(err) 32 - return(0); 32 + return(-1UL); 33 33 phys = um_virt_to_phys(current, virt, NULL); 34 34 } 35 + if(IS_ERR(phys)) 36 + phys = (void *) -1; 37 + 35 38 return((unsigned long) phys); 36 39 } 37 40 ··· 45 42 int n; 46 43 47 44 addr = maybe_map(addr, is_write); 48 - if(addr == -1) 45 + if(addr == -1UL) 49 46 return(-1); 50 47 51 48 page = phys_to_page(addr);
-1
arch/um/kernel/syscall_kern.c
··· 17 17 #include "linux/utime.h" 18 18 #include "asm/mman.h" 19 19 #include "asm/uaccess.h" 20 - #include "asm/ipc.h" 21 20 #include "kern_util.h" 22 21 #include "user_util.h" 23 22 #include "sysdep/syscalls.h"
+1 -1
arch/um/kernel/trap_kern.c
··· 48 48 goto good_area; 49 49 else if(!(vma->vm_flags & VM_GROWSDOWN)) 50 50 goto out; 51 - else if(!ARCH_IS_STACKGROW(address)) 51 + else if(is_user && !ARCH_IS_STACKGROW(address)) 52 52 goto out; 53 53 else if(expand_stack(vma, address)) 54 54 goto out;
+1 -1
arch/um/sys-x86_64/signal.c
··· 168 168 169 169 frame = (struct rt_sigframe __user *) 170 170 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 171 - frame -= 128; 171 + ((unsigned char *) frame) -= 128; 172 172 173 173 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 174 174 goto out;
+2
arch/um/sys-x86_64/syscalls.c
··· 44 44 #ifdef CONFIG_MODE_SKAS 45 45 extern int userspace_pid[]; 46 46 47 + #include "skas_ptrace.h" 48 + 47 49 long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) 48 50 { 49 51 struct ptrace_ldt ldt;