linux/arch
Linus Torvalds cae2a173fe x86: clean up/fix 'copy_in_user()' tail zeroing
The rule for 'copy_from_user()' is that it zeroes the remaining kernel
buffer even when the copy fails halfway, just to make sure that we don't
leave uninitialized kernel memory around.  Because even if we check for
errors, some kernel buffers stay around after thge copy (think page
cache).

However, the x86-64 logic for user copies uses a copy_user_generic()
function for all the cases, that set the "zerorest" flag for any fault
on the source buffer.  Which meant that it didn't just try to clear the
kernel buffer after a failure in copy_from_user(), it also tried to
clear the destination user buffer for the "copy_in_user()" case.

Not only is that pointless, it also means that the clearing code has to
worry about the tail clearing taking page faults for the user buffer
case.  Which is just stupid, since that case shouldn't happen in the
first place.

Get rid of the whole "zerorest" thing entirely, and instead just check
if the destination is in kernel space or not.  And then just use
memset() to clear the tail of the kernel buffer if necessary.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-08 14:28:45 -07:00
..
alpha asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
arc ARC: signal handling robustify 2015-03-26 11:19:36 +05:30
arm ARM: SoC fixes 2015-03-29 15:09:31 -07:00
arm64 ARM: SoC fixes 2015-03-29 15:09:31 -07:00
avr32 asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
blackfin Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-02-21 12:59:04 -08:00
c6x arch/c6x/include/asm/pgtable.h: define dummy pgprot_writecombine for !MMU 2015-03-12 18:46:08 -07:00
cris
frv mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines 2015-02-28 09:57:51 -08:00
hexagon
ia64 asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
m32r mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines 2015-02-28 09:57:51 -08:00
m68k mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines 2015-02-28 09:57:51 -08:00
metag metag: Fix ioremap_wc/ioremap_cached build errors 2015-03-23 12:32:37 +00:00
microblaze microblaze: Fix syscall error recovery for invalid syscall IDs 2015-03-04 15:12:27 +01:00
mips KVM: MIPS: Enable after disabling interrupt 2015-03-02 19:18:12 -03:00
mn10300 mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines 2015-02-28 09:57:51 -08:00
nios2 nios2: mm: do not invoke OOM killer on kernel fault OOM 2015-03-16 15:35:25 +08:00
openrisc asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
parisc parisc: Fix pmd code to depend on PT_NLEVELS value, not on CONFIG_64BIT 2015-03-23 12:28:16 +01:00
powerpc powerpc: fix memory corruption by pnv_alloc_idle_core_states 2015-04-01 12:05:44 +11:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2015-03-26 14:11:17 -07:00
score
sh asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
sparc sparc64: Fix several bugs in memmove(). 2015-03-23 09:22:10 -07:00
tile
um
unicore32
x86 x86: clean up/fix 'copy_in_user()' tail zeroing 2015-04-08 14:28:45 -07:00
xtensa asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
.gitignore
Kconfig