lkml.org 
[lkml]   [2006]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i386 - sys_clone from vsyscall
Thanks for your work on the patch

> Your patch almost works but it copies the stack into the parent's address space.
> Using access_process_vm() fixes it. However, that still leaves unfixed the case
> where vsyscall-int80 is used.

I copy the stack into the parent's address space becuase in this case
the memory is shared, but access_process_vm() is more elegant :).
About vsyscall-int80, I don't know how to test that case in my
computer but I think a solution could be:

add a INT80H_RETURN symbol:

.LSTART_vsyscall:
int $0x80
.globl INT80H_RETURN
INT80H_RETURN:
ret
.LEND_vsyscall:

and then in process.c:

int size = 0 ;
childregs->eax = 0;

if ((void *)regs->eip == SYSENTER_RETURN)
size = sizeof(vsyscall_stack) ;
if ((void *)regs->eip == INT80H_RETURN)
size = sizeof(unsigned long) ;

if (regs->esp != esp && size) {
if (copy_from_user(vsyscall_stack, (void *)regs->esp, size))
return -EFAULT;
if (access_process_vm(p, esp - size, vsyscall_stack,
size, 1) != size)
return -EFAULT;
esp -= size;
}
childregs->esp = esp;

I hope somebody can test if it works that way.
Regards
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-26 18:05    [W:0.037 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site