On Thu, 2002-11-07 at 06:56, Ville Syrj�l� wrote:
> The matroxfb patch that is included in DirectFB is broken. Here's a new
> patch. get_user() usage was apparently wrong. So I threw it out and things
> work a lot better.
>
Is there anything wrong with the following?
int c
if (get_user(c, (u32 *) arg)
return -EFAULT;
The user access macros are the only way the kernel protects itself from
illegal pointers from user space. If I have an old app that do this:
ioctl(fd, FBIO_WAITFORVSYNC)
then the driver will get random values from memory, or worse, do an
'Oops'. The get_user() macro, because it hooks up with the kernel's
exception handlers, will not do a segfault, but will return with a
non-zero number.
You can even do something like this to provide compatibility, but it's
not advisable:
int c, err
err = get_user(c, (u32 *) arg);
if (err)
"no argument passed, assume old interface"
else
"argument passed, new interface"
Tony
--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with
"unsubscribe directfb-dev" as subject.