kernel_optimize_test/arch/x86
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
..
boot Revert "x86/mm/ASLR: Propagate base load address calculation" 2015-03-16 11:18:21 +01:00
configs
crypto crypto: aesni - fix memory usage in GCM decryption 2015-03-13 21:32:21 +11:00
ia32
include x86: clean up/fix 'copy_in_user()' tail zeroing 2015-04-08 14:28:45 -07:00
kernel Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-03 10:42:32 -07:00
kvm KVM: x86: call irq notifiers with directed EOI 2015-03-23 20:29:05 -03:00
lguest lguest: update help text. 2015-02-19 14:44:32 +10:30
lib x86: clean up/fix 'copy_in_user()' tail zeroing 2015-04-08 14:28:45 -07:00
math-emu
mm Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-02-21 10:41:29 -08:00
net
oprofile
pci Revert "x86/PCI: Refine the way to release PCI IRQ resources" 2015-03-20 14:56:19 +01:00
platform Merge branch 'linus' into x86/urgent, to merge dependent patch 2015-02-28 08:03:10 +01:00
power
purgatory
realmode Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-02-16 14:58:12 -08:00
syscalls
tools
um
vdso x86/vdso: Fix the build on GCC5 2015-03-06 09:34:45 +01:00
video
xen x86/xen: prepare p2m list for memory hotplug 2015-03-23 15:14:47 +00:00
.gitignore
Kbuild
Kconfig x86/intel/quark: Select COMMON_CLK 2015-03-05 17:44:53 +01:00
Kconfig.cpu
Kconfig.debug x86/intel/quark: Add Isolated Memory Regions for Quark X1000 2015-02-18 23:22:47 +01:00
Makefile
Makefile_32.cpu
Makefile.um