Re: copy_from_user() fix

Richard Gooch (rgooch@atnf.csiro.au)
Thu, 27 Aug 1998 07:55:28 +1000


David S. Miller writes:
> Date: Wed, 26 Aug 1998 10:55:30 +0200
> From: Martin Mares <mj@ucw.cz>
>
> To be honest, I see more legitimate advantages in SIGSEGV than
> in EFAULT. The only advantage of EFAULT is easy checking by
> callers which is IMHO used rarely. On the other hand, if you use
> SIGSEGV, you can get the faulting address and you get all accesses
> to invalid addresses trapped, making such (potentially dangerous,
> especially in security sensitive apps) cases easy to spot.
>
> Consider a userland pointer verification library that worked in about
> 10 lines of code by passing the pointer in question to a sys_write()
> call to /dev/null... but this wouldn't work actually these days due to
> how the kernel won't even verify the pointer in this case.

For any implementation where writing to /dev/null does nothing, this
is true. But reading from /dev/zero still has to work, which makes it
an excellent test for writability.

> But I am sure other interesting examples could be conceived.

Yeah, just fork(2)/create a thread and use a pipe.

Regards,

Richard....

-
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