linux/arch/mips/lib
Ralf Baechle e03b526932 [MIPS] Fixup copy_from_user_inatomic
From the 01408c4939 log message:

The problem is that when we write to a file, the copy from userspace to
pagecache is first done with preemption disabled, so if the source
address is not immediately available the copy fails *and* *zeros* *the*
*destination*.

This is a problem because a concurrent read (which admittedly is an odd
thing to do) might see zeros rather that was there before the write, or
what was there after, or some mixture of the two (any of these being a
reasonable thing to see).

If the copy did fail, it will immediately be retried with preemption
re-enabled so any transient problem with accessing the source won't
cause an error.

The first copying does not need to zero any uncopied bytes, and doing
so causes the problem.  It uses copy_from_user_atomic rather than
copy_from_user so the simple expedient is to change copy_from_user_atomic
to *not* zero out bytes on failure.

< --- end cite --- >

This patch finally implements at least a not so pretty solution by
duplicating the relevant part of __copy_user.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-02-20 01:26:42 +00:00
..
Makefile [MIPS] Fixup copy_from_user_inatomic 2007-02-20 01:26:42 +00:00
ashldi3.c [MIPS] Fix optimization for size build. 2006-06-19 17:39:16 +01:00
ashrdi3.c [MIPS] Fix optimization for size build. 2006-06-19 17:39:16 +01:00
csum_partial.S [MIPS] csum_partial and copy in parallel 2007-01-08 21:41:04 +00:00
iomap-pci.c [MIPS] Iomap implementation. 2007-02-18 21:31:34 +00:00
iomap.c [MIPS] Iomap implementation. 2007-02-18 21:31:34 +00:00
libgcc.h [MIPS] Fix optimization for size build. 2006-06-19 17:39:16 +01:00
lshrdi3.c [MIPS] Fix optimization for size build. 2006-06-19 17:39:16 +01:00
memcpy-inatomic.S [MIPS] Fixup copy_from_user_inatomic 2007-02-20 01:26:42 +00:00
memcpy.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
memset.S [MIPS] Unify memset.S 2007-02-06 16:53:12 +00:00
promlib.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
strlen_user.S kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
strncpy_user.S kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
strnlen_user.S kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
uncached.c [MIPS] Fix warnings in run_uncached on 32bit kernel 2007-02-06 16:53:24 +00:00