Re: BUG: mmapfile/writev spurious zero bytes (x86_64/not i386, bisected, reproducable)

From: Andi Kleen
Date: Tue Jun 17 2008 - 17:00:21 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

>
> So I'm starting to think the bug is all in there, not in the VM itself.
> See arch/x86/lib/copy_user_nocache.S.

The x86-64 copy_*_user functions were always designed to return errors
both ways (as in both for load and for store). That's needed because
the loops are shared for copy_to_user and copy_from_user. That's normally
ok because when you do _to_user you shouldn't fault on the loads
and vice versa. If a caller does that it's buggy.

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