lkml.org 
[lkml]   [1998]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: copy_from_user() fix
From
Date
In article <19980824195231.22385@bug.ucw.cz>,
Pavel Machek <pavel@bug.ucw.cz> writes:
> Hi!
>> > > Thats a matter for glibc. If you wrap the glibc syscall macros to do
>> > > a raise(SIGSEGV) then you get your desire. So its a non kernel item ;)
>> >
>> > Still, I think that this could be in kernel. It is faster to do here
>> > (you can SIGSEGV it directly from pagefault handler), and IMO you
>> > _should_ get SIGSEGV for read(0,0,1)...
>>
>> Since when has SIGSEGV on a memory error been performance critical ?

> It is not. But read again your solution (marked with smiley ;):

> You propose to slow down every syscall return by test
> if (retcode == -EFAULT) raise(SIGSEGV).

If you look at glibc's syscall code:

...
int $0x80 ;call system
cmpl $-4096,%eax
jae syscall_error
ret

and syscall_error is a single function used for every syscall. So you
just need to add a short check to syscall_error and you're done.


-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.091 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site