Re: copy_from/to_user

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Fri Mar 03 2000 - 07:42:30 EST


On Thu, 2 Mar 2000, pramodh mallipatna wrote:

> Hello All,
>
> I am able to access user memory in the kernel without copy_from/to_user().
> I did this by mistake and the kernel did not kick me for doing so.
> It is not supposed to do so, right?
>
> I am using 2.2.5 kernel. But, I observed it in 2.2.9 kernels also.
>

You were just lucky that the user pages were still in memory. The
problem with such code is that it seems to work throughout rigorous
testing which seems to "prove" that it's okay. It is, in fact, the
rigorous testing that keeps your pages in memory so everything seems
okay.

You need to use copy/from/to_user() so page faulting will work.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).

-
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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:14 EST