Re: bug in write(2) system call.

Chris Wedgwood (chris@cybernet.co.nz)
Wed, 21 Oct 1998 10:50:20 +1300


On Tue, Oct 20, 1998 at 04:15:23PM -0300, Horst von Brand wrote:

> > There is no wrong or right way - and no simple fix other than DON'T
> > PASS BOGUS POINTERS TO THE KERNEL.
>
> You should try not to, but the kernel _can't_ just believe in your
> guarantees. For all it knows, you might be Kubys ;-)

Applications passing bogus pointers shouldn't kill the kernel, but
arguably, it can do anything it like to your application, including
wrapping in in cellophane and sending it you your mom for xmas.

> In the 2.1.xx kernels this mechanism was replaced by a nifty,
> no-overhead use of the MM to do the same thing: No checks, but if
> an illegal access is attempted, the kernel gets an exception. Look
> at your nearest Documentation directory.

I know what 2.1.x does - and because of the way 2.1.x works we have
this inconsistency. Personally, I like the way 2.1.x does things and
thing people shouldn't _rely_ on EFAULT and other errors when doing
bogus things, although it can be very useful (I use it myself, I'm
sure plenty of people do - but if it breaks, I can't really blame the
kernel).

-cw

-
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.tux.org/lkml/