Messages in this thread | | | Date | Mon, 31 Aug 1998 21:05:23 | From | David Bruce <> | Subject | Re: copy_from_user() fix |
| |
Hello
At 08:04 pm 24/8/1998 +0200, Pavel Machek wrote: >Hi! > >> > > > Also, I still maintain there should be a mode to raise SIGSEGV >> > > > whenever a system call returns EFAULT. Not doing so breaks the system >> > > > call/library routine transparency, and lets bugs go uncaught. >> > > >> > > 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)... >> >> ??? What's wrong with EFAULT? > >Consistency: if you pass bad pointer to library function, behaviour is >undefined, but you probably get SIGSEGV.
So what you are saying is that you want the kernel to be as inconsitant as the library and in that way be consistant. :)
>If you pass bad pointer to kernel, behaviour is defined to return >-EFAULT. And now, imagine you want to place read into library (I >almost tried that). You would have to play nasty tricks with SIGSEGV >handlers... > >IMO behaviour of library and kernel functions should be similar - they >both should SIGSEGV you. > > Pavel
IMO behaviour of library and kernel functions should be the same - they both should return EFAULT. The kernel came first.
David Bruce
CRASH(8) no fs A device has disappeared from the mounted-device table. Definitely hardware or software error.
Unix Version 7 Manual
David Bruce <david@hulcote.com> Hulcote Electronics (Europe) Ltd. Manton Lane. Bedford, MK41 7UZ U.K. (Tel) +44 (0)1234 344206 (Fax) +44 (0)1234 269538
- 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
| |