Re: AUDIT: copy_from_user is a deathtrap.

Andi Kleen
2002-05-20T10:59:25Z

Rusty Russell <rusty@rustcorp.com.au> writes:

> In message <Pine.LNX.4.44.0205191951460.22433-100000@home.transmeta.com> you wr
> ite:
> > ret = copy_from_user(xxx);
> > if (ret)
> > return ret;
> >
> > which is apparently your suggestion.
>
> Not quite:
> copy_from_user(xxx);
>
> Is my suggestion. No error return.

I don't think it is a good idea. Consider a driver that does lots
of small copy_from_user() from user space for a longer write (e.g. TCP
to a small MSS) If xxx was faulting it would eat a lot of cycles with
faulting again and again.

-Andi