Re: i486 emu in mainline?

From: Andrew Morton
Date: Sun May 23 2004 - 04:22:37 EST


Willy Tarreau <willy@xxxxxxxxx> wrote:
>
> On Sun, May 23, 2004 at 09:13:20AM +0200, Arjan van de Ven wrote:
> > on first look it seems to be missing a bunch of get_user() calls and
> > does direct access instead....
>
> It was intentional for speed purpose. The areas are checked once with
> verify_area() when we need to access memory, then data is copied directly
> from/to memory. I don't think there's any risk, but I can be wrong.

verify_area() simply checks that the address is a legal one for a userspace
access (it's not a chunk of kernel memory). But the kernel can still take
a pagefault when accessing the address, so you need to use the uaccess
functions which will handle the fault appropriately.

That's put_user(), get_user(), copy_*_user(), etc. Those functions
internally perform verify_area(), so if you've already done a verify_area()
you can use __put_user(), __get_user(), etc which skip the verify_area()
but which still know how to deal with user address faults.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/