Re: copy_from_user() fix

David S. Miller (davem@dm.cobaltmicro.com)
Wed, 26 Aug 1998 04:17:34 -0700


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.

But I am sure other interesting examples could be conceived.

Later,
David S. Miller
davem@dm.cobaltmicro.com

-
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