Re: to make vmalloc()/vfree() one needs to...

Tigran Aivazian (tigran@sco.COM)
Fri, 10 Dec 1999 17:01:44 +0000 (GMT)


On Fri, 10 Dec 1999, Manfred Spraul wrote:
> vread() is only called from drivers/char/mem.c, ie it's not time
> critical.

I know that. But vread() is also suitable for /proc/kcore so I was
considering to use it there in the future (but that is not time-critical
either). Also, while we are at it, we need vwrite() because at the moment
write_kmem() just returns 0 if pos>=high_memory.

> I would either _always_ loop, or use a short (eg 64) byte temporary
> buffer on the stack.

The user address passed to vread() belongs to process' address space.
What is the worst thing that can happen to it - another thread sharing
the same address space can cause it to be unmapped. Is there no way to
prevent it from happening? Why can't I say something like
kmap_user_range(uaddr, len) (which would EFAULT if this combination is
invalid)? file_read_actor() can kmap() a page so there should be a way to
kmap() more than 1 page?

Regards,
Tigran.

-
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/