Re: [PATCH] [1/2] random: SMP locking

From: Andrew Morton (akpm@osdl.org)
Date: Sat Aug 02 2003 - 13:39:07 EST


Zwane Mwaikambo <zwane@arm.linux.org.uk> wrote:
>
> Perhaps might_sleep() in *_user, copy_* etc is in order?

Probably, with a little care.

A userspace copy while in an atomic region is actually legal, on behalf of
the read() and write() pagecache copy functions: if we take a fault while
holding an atomic kmap, the fault handler bales and the usercopy returns a
short copy.

In other words: if you stick a might_sleep() in __copy_from_user() and
__copy_to_user() you get a false positive on every read() and write().

We could probably add it to copy_to_user() and copy_from_user() though.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:19 EST