linux/include/asm-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
ddb5xxx [MIPS] Make I8259A_IRQ_BASE customizable 2007-02-06 16:53:09 +00:00
dec [TC] TURBOchannel support for the DECstation 2007-02-09 16:23:16 +00:00
emma2rh [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
ip32
jmr3927
lasat
mach-atlas
mach-au1x00 [MIPS] Alchemy: Fix PCI-memory access 2007-02-06 16:53:24 +00:00
mach-cobalt [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
mach-db1x00
mach-dec
mach-emma2rh [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
mach-ev64120
mach-excite
mach-generic [MIPS] Unify dma-{coherent,noncoherent.ip27,ip32} 2007-02-13 22:40:50 +00:00
mach-ip22
mach-ip27 [MIPS] Unify dma-{coherent,noncoherent.ip27,ip32} 2007-02-13 22:40:50 +00:00
mach-ip32 [MIPS] Unify dma-{coherent,noncoherent.ip27,ip32} 2007-02-13 22:40:50 +00:00
mach-ja
mach-jazz [MIPS] Unify dma-{coherent,noncoherent.ip27,ip32} 2007-02-13 22:40:50 +00:00
mach-jmr3927
mach-lasat
mach-mips [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
mach-ocelot
mach-ocelot3
mach-pb1x00
mach-pnx8550
mach-qemu
mach-rm [MIPS] Support for several more SNI RM models. 2007-02-18 21:31:37 +00:00
mach-sibyte
mach-sim
mach-vr41xx [MIPS] Make I8259A_IRQ_BASE customizable 2007-02-06 16:53:09 +00:00
mach-wrppmc
mach-yosemite
mips-boards [MIPS] prom_free_prom_memory cleanup 2007-02-06 16:53:09 +00:00
pci
sgi [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
sibyte
sn [MIPS] IP27: Move definition of nic_t to its sole user. 2006-12-12 01:46:24 +00:00
tx4927
tx4938
vr41xx [MIPS] Make I8259A_IRQ_BASE customizable 2007-02-06 16:53:09 +00:00
xtalk
8253pit.h
a.out.h
abi.h [MIPS] signals: Share even more code. 2007-02-18 21:31:35 +00:00
addrspace.h
asm.h
asmmacro-32.h
asmmacro-64.h
asmmacro.h
atomic.h [MIPS] Improve branch prediction in ll/sc atomic operations. 2007-02-13 22:40:50 +00:00
auxvec.h
barrier.h
bcache.h
bitops.h [MIPS] Use MIPS R2 instructions for bitops. 2007-02-18 21:31:35 +00:00
bootinfo.h [MIPS] prom_free_prom_memory cleanup 2007-02-06 16:53:09 +00:00
branch.h
break.h
bug.h
bugs.h
byteorder.h
cache.h
cachectl.h
cacheflush.h [PATCH] Optimize D-cache alias handling on fork 2006-12-13 09:27:08 -08:00
cacheops.h
checksum.h [MIPS] Fix wrong checksum calculation on 64-bit MIPS 2007-01-24 19:23:22 +00:00
compat-signal.h [MIPS] signals: Share even more code. 2007-02-18 21:31:35 +00:00
compat.h [MIPS] compat.h uses struct pt_regs so needs to include ptrace.h. 2006-12-12 01:46:24 +00:00
compiler.h
cpu-features.h
cpu-info.h
cpu.h
cputime.h
current.h
debug.h
delay.h
device.h
div64.h
dma-mapping.h [MIPS] Don't claim we support dma_declare_coherent_memory - we don't. 2007-02-13 22:40:50 +00:00
dma.h [MIPS] Setup min_low_pfn/max_low_pfn correctly 2007-02-06 16:53:13 +00:00
ds1216.h [MIPS] Support for several more SNI RM models. 2007-02-18 21:31:37 +00:00
ds1286.h
ds1742.h
dsp.h
elf.h
emergency-restart.h
errno.h
fcntl.h
fixmap.h
floppy.h
fpregdef.h
fpu_emulator.h
fpu.h
futex.h
gdb-stub.h
gfx.h
gt64120.h
gt64240.h
hardirq.h
hazards.h [MIPS] vr41xx: need one more nop with mtc0_tlbw_hazard() 2007-01-24 19:23:21 +00:00
highmem.h
hw_irq.h
i8259.h [MIPS] Make I8259A_IRQ_BASE customizable 2007-02-06 16:53:09 +00:00
ide.h
inst.h
inventory.h
io.h [MIPS] Iomap implementation. 2007-02-18 21:31:34 +00:00
ioctl.h
ioctls.h
ipc.h
ipcbuf.h
irq_cpu.h [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
irq_regs.h
irq.h [MIPS] Make I8259A_IRQ_BASE customizable 2007-02-06 16:53:09 +00:00
irqflags.h [MIPS] SMTC: Instant IPI replay. 2007-01-23 18:26:47 +00:00
isadep.h
jazz.h
jazzdma.h
Kbuild
kexec.h
kmap_types.h
kspd.h
linkage.h
local.h
m48t35.h
m48t37.h
marvell.h
mc146818-time.h
mc146818rtc.h
mips_mt.h [MIPS] VPE: Sprinkle device model code into code to make udev happier. 2007-02-10 22:38:42 +00:00
mipsmtregs.h [MIPS] MT: Nuke duplicate mips_mt_regdump() prototype. 2007-02-06 16:53:24 +00:00
mipsprom.h
mipsregs.h
mman.h [PATCH] Remove final references to deprecated "MAP_ANON" page protection flag 2007-02-11 10:51:17 -08:00
mmu_context.h
mmu.h
mmzone.h
module.h
msc01_ic.h
msgbuf.h
mutex.h
namei.h
nile4.h
paccess.h
page.h [MIPS] FLATMEM: introduce PHYS_OFFSET. 2007-02-06 16:53:13 +00:00
param.h
parport.h
pci.h [MIPS] Iomap implementation. 2007-02-18 21:31:34 +00:00
percpu.h
pgalloc.h [MIPS] Add external declaration of pagetable_init() to pgalloc.h 2007-02-18 21:31:36 +00:00
pgtable-32.h
pgtable-64.h
pgtable-bits.h
pgtable.h [PATCH] mm: mremap correct rmap accounting 2007-01-30 08:33:32 -08:00
pmon.h
poll.h
posix_types.h
prctl.h
prefetch.h
processor.h
ptrace.h [MIPS] Move die and die_if_kernel() from system.h to ptrace.h 2006-12-10 21:52:11 +00:00
qemu.h
r4kcache.h
reboot.h
reg.h
regdef.h
resource.h
rm9k-ocd.h
rtc.h
rtlx.h [MIPS] Define MIPS_CPU_IRQ_BASE in generic header 2007-02-06 16:53:08 +00:00
scatterlist.h
sections.h [MIPS] Remove _fdata from asm-mips/sections.h 2007-02-06 16:53:15 +00:00
segment.h
semaphore.h
sembuf.h
serial.h
setup.h
sgialib.h
sgiarcs.h
sgidefs.h
shmbuf.h
shmparam.h
sigcontext.h [MIPS] Fix struct sigcontext for N32 userland 2007-02-20 01:26:42 +00:00
siginfo.h
signal.h [MIPS] signals: Share even more code. 2007-02-18 21:31:35 +00:00
sim.h
smp.h
smtc_ipi.h [MIPS] SMTC: Make a bunch of functions and variables static. 2007-02-06 16:53:22 +00:00
smtc_proc.h
smtc.h
sni.h [MIPS] Support for several more SNI RM models. 2007-02-18 21:31:37 +00:00
socket.h
sockios.h
sparsemem.h
spinlock_types.h
spinlock.h [MIPS] Improve branch prediction in ll/sc atomic operations. 2007-02-13 22:40:50 +00:00
stackframe.h
stacktrace.h
stat.h
statfs.h
string.h
suspend.h
sysmips.h
system.h [MIPS] Improve branch prediction in ll/sc atomic operations. 2007-02-13 22:40:50 +00:00
termbits.h
termios.h [PATCH] consolidate line discipline number definitions 2007-02-11 10:51:26 -08:00
thread_info.h [MIPS] Fix APM build 2007-01-24 19:23:21 +00:00
time.h
timex.h
titan_dep.h
tlb.h
tlbdebug.h
tlbflush.h
topology.h
traps.h
tx3912.h
types.h
uaccess.h [MIPS] Fixup copy_from_user_inatomic 2007-02-20 01:26:42 +00:00
ucontext.h
unaligned.h
unistd.h
user.h
vga.h
vpe.h
war.h
watch.h
wbflush.h
xor.h
xxs1500.h