linux/arch/mips
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
..
arc [MIPS] Use ARRAY_SIZE macro when appropriate 2007-02-06 16:53:19 +00:00
au1000 [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
basler/excite [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
boot Add .gitignore files for MIPS. 2005-11-07 18:05:37 +00:00
cobalt [MIPS] prom_free_prom_memory cleanup 2007-02-06 16:53:09 +00:00
configs [MIPS] Update defconfigs 2007-02-18 21:31:37 +00:00
ddb5xxx [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
dec [MIPS] DECstation: Fix irq handling 2007-02-13 22:40:51 +00:00
emma2rh [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
gt64120 [MIPS] Remove superfluous "ifdef CONFIG_KGDB". 2007-02-06 16:53:17 +00:00
jazz [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
jmr3927 [MIPS] Use ARRAY_SIZE macro when appropriate 2007-02-06 16:53:19 +00:00
kernel [MIPS] Make some __setup functions static 2007-02-20 01:26:41 +00:00
lasat [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
lib [MIPS] Fixup copy_from_user_inatomic 2007-02-20 01:26:42 +00:00
lib-32 [MIPS] Unify memset.S 2007-02-06 16:53:12 +00:00
lib-64 [MIPS] Unify memset.S 2007-02-06 16:53:12 +00:00
math-emu [MIPS] Make sure cpu_has_fpu is used only in atomic context 2006-10-09 23:20:48 +01:00
mips-boards [MIPS] Use ARRAY_SIZE macro when appropriate 2007-02-06 16:53:19 +00:00
mm [MIPS] Declare highstart_pfn, highend_pfn only if CONFIG_HIGHMEM=y 2007-02-20 01:26:41 +00:00
momentum [MIPS] Fix eth2 platform device id for jaguar_atx and ocelot_3 platforms 2007-02-10 22:38:44 +00:00
oprofile [MIPS] Do not allow oprofile to be enabled on SMTC. 2007-02-06 16:53:17 +00:00
pci [MIPS] Support for several more SNI RM models. 2007-02-18 21:31:37 +00:00
philips/pnx8550 [PATCH] proc: remove useless (and buggy) ->nlink settings 2007-02-11 10:51:32 -08:00
pmc-sierra [MIPS] Yosemite: Fix missing parens in SERIAL_READ_1 macro 2007-02-06 16:53:25 +00:00
qemu [MIPS] prom_free_prom_memory cleanup 2007-02-06 16:53:09 +00:00
sgi-ip22 [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
sgi-ip27 [MIPS] Add external declaration of pagetable_init() to pgalloc.h 2007-02-18 21:31:36 +00:00
sgi-ip32 [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
sibyte [PATCH] mark struct file_operations const 2 2007-02-12 09:48:44 -08:00
sni [MIPS] Support for several more SNI RM models. 2007-02-18 21:31:37 +00:00
tx4927 [MIPS] RBTX49x7: declare prom_getcmdline() 2007-02-10 22:38:43 +00:00
tx4938 [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
vr41xx [MIPS] vr41xx: Use symbolic names for IRQ numers 2007-02-06 16:53:15 +00:00
defconfig [MIPS] Update defconfigs 2007-02-18 21:31:37 +00:00
Kconfig [MIPS] Allow selection of KGDB only on platforms where it's supported. 2007-02-20 01:26:41 +00:00
Kconfig.debug [MIPS] Allow selection of KGDB only on platforms where it's supported. 2007-02-20 01:26:41 +00:00
Makefile [MIPS] There is no __GNUC_MAJOR__ 2007-01-24 19:23:21 +00:00