linux/arch
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
..
alpha [PATCH] Dynamic kernel command-line: alpha 2007-02-12 09:48:37 -08:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-02-19 13:29:02 -08:00
arm26 [PATCH] Dynamic kernel command-line: arm26 2007-02-12 09:48:37 -08:00
avr32 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2007-02-19 13:18:39 -08:00
cris arch/cris: typo in KERN_INFO 2007-02-17 20:12:12 +01:00
frv [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
h8300 [PATCH] Declare init_irq_proc before we use it. 2007-02-19 14:21:50 -08:00
i386 [PATCH] tick management: make broadcast dependent on local APIC 2007-02-19 14:22:43 -08:00
ia64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-02-19 13:29:02 -08:00
m32r Various typo fixes. 2007-02-17 19:07:33 +01:00
m68k [PATCH] Declare init_irq_proc before we use it. 2007-02-19 14:21:50 -08:00
m68knommu [PATCH] Declare init_irq_proc before we use it. 2007-02-19 14:21:50 -08:00
mips [MIPS] Fixup copy_from_user_inatomic 2007-02-20 01:26:42 +00:00
parisc Replace remaining references to "driverfs" with "sysfs". 2007-02-17 19:13:42 +01:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-02-19 13:29:02 -08:00
ppc [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
s390 [PATCH] clocksource: fixup is_continous changes on S390 2007-02-16 08:13:57 -08:00
sh Storage class should be before const qualifier 2007-02-17 20:11:19 +01:00
sh64 [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
sparc [SPARC]: Re-export saved_command_line to modules. 2007-02-12 15:15:48 -08:00
sparc64 [SPARC]: Re-export saved_command_line to modules. 2007-02-12 15:15:48 -08:00
um [PATCH] uml: fix 2.6.20 hang 2007-02-16 08:13:56 -08:00
v850 kbuild: Replace remaining "depends" with "depends on" 2007-02-17 19:05:24 +01:00
x86_64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-02-19 13:29:02 -08:00
xtensa [PATCH] Dynamic kernel command-line: xtensa 2007-02-12 09:48:39 -08:00