Re: copy_from_user() fixu

Chris Wedgwood (chris@cybernet.co.nz)
Tue, 25 Aug 1998 20:13:16 +1200


On Tue, Aug 25, 1998 at 01:04:24AM -0700, H. Peter Anvin wrote:

> I doubt it... Linux printk()'s if it ever returns EFAULT to an app,

not anymore on intel (in fact, maybe not on other archs either now
that I test it), the code that does this was removed some time ago.

compile this:

--
main()
{
        write(0,-1,10);
}
--

and see if dmesg show anything. on intel, it doesn't. On alpha I get:

a.out: Exception at [<fffffc00003bd844>] (fffffc00003bd84c)

type of thing.

(in fact, this makes a DoS possible and probably should be disable by default)

> and the only thing that ever did get it and work was ar (which has > since been fixed.)

Nope... various bits an peices have done this. I definately saw older flavours of gcc doing this, but then again, it could have been libc or one of 10 other things.

Anyhow, applications sometimes do pass bogus arguments, and sometimes if they detect a -1 returned but aren't so sure about errno, can and do recover in full or in part. Having apps. segfault here seems like a good way to break (and debug) lots of existing code...

-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.altern.org/andrebalsa/doc/lkml-faq.html