Re: [Qemu-devel] Fix for accept

2006-07-14 Thread Fabrice Bellard
Pablo Virolainen wrote: So I should write something like following instead? if (!get_user(addrlen,&target_addrlen)) { return -EFAULT } Yes. The code seems to assume target_sockaddr == sockaddr, so why allocate temporary buffer and then do copying? If the assumpti

Re: [Qemu-devel] Fix for accept

2006-07-14 Thread Pablo Virolainen
Fabrice Bellard wrote: > Hi, > > OK for the bug report, but the fix is not correct because the problem > is generic. [get|put]_user() and the other functions should be used > everywhere to communicate with the "user" space and to generate the > -EFAULT error if the address is not correct. For that

Re: [Qemu-devel] Fix for accept

2006-07-13 Thread Fabrice Bellard
Hi, OK for the bug report, but the fix is not correct because the problem is generic. [get|put]_user() and the other functions should be used everywhere to communicate with the "user" space and to generate the -EFAULT error if the address is not correct. For that purpose the host signal SIGSE

[Qemu-devel] Fix for accept

2006-07-13 Thread Pablo Virolainen
Following code crashes qemu user emulation. #include #include int main() { accept(0,NULL,NULL); return 0; } Pablo Virolainen Index: linux-user/syscall.c === RCS file: /sources/qemu/qemu/linux-user/syscall.c,v retr