Re: vremap and memcpy_to_fs in 2.2.x?


Richard Henderson (rth@twiddle.net)
Wed, 7 Apr 1999 13:07:46 -0700


On Wed, Apr 07, 1999 at 02:15:19PM -0400, AARON MARKS wrote:
> > > vremap() -> ioremap()
> >
> > This is correct.
>
> I ended up using phys_to_virt() instead.

These are very different things, and are not interchangeable.
What do you think you are doing?

> And for this, I just did a straight assignment:
>
> This:
> memcpy_tofs(out, &si, sizeof(si));
>
> Became this:
> *out = si;

Wrong wrong wrong wrong wrong!

DO USE copy_to_user or put_user. First, it plugs big oops leaks.
Second, nice systems like m68k or Sparc64 put userland in a
completely different address space, so assignment won't even
pretend to begin to work.

r~

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com



This archive was generated by hypermail 2.0b3 on Wed Apr 07 1999 - 14:00:11 PDT