linux/arch/powerpc
Anton Blanchard a11940978b powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe
If we echo an address the hypervisor doesn't like to
/sys/devices/system/memory/probe we oops the box:

# echo 0x10000000000 > /sys/devices/system/memory/probe

kernel BUG at arch/powerpc/mm/hash_utils_64.c:541!

The backtrace is:

create_section_mapping
arch_add_memory
add_memory
memory_probe_store
sysdev_class_store
sysfs_write_file
vfs_write
SyS_write

In create_section_mapping we BUG if htab_bolt_mapping returned
an error. A better approach is to return an error which will
propagate back to userspace.

Rerunning the test with this patch applied:

# echo 0x10000000000 > /sys/devices/system/memory/probe
-bash: echo: write error: Invalid argument

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@kernel.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-09-20 15:53:23 +10:00
..
boot Merge remote-tracking branch 'origin/master' into next 2011-09-20 15:52:38 +10:00
configs Merge remote-tracking branch 'origin/master' into next 2011-09-20 15:52:38 +10:00
include/asm powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe 2011-09-20 15:53:23 +10:00
kernel powerpc: Coding style cleanups 2011-09-20 15:53:23 +10:00
kvm powerpc/kvm: Fix build errors with older toolchains 2011-08-05 14:47:56 +10:00
lib Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2011-05-20 13:28:01 -07:00
math-emu powerpc/85xx: Fix SPE float to integer conversion failure 2011-03-15 13:48:15 -05:00
mm powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe 2011-09-20 15:53:23 +10:00
net net: filter: BPF 'JIT' compiler for PPC64 2011-07-21 12:38:32 -07:00
oprofile powerpc/oprofile: Handle events that raise an exception without overflowing 2011-05-26 13:38:57 +10:00
platforms powerpc/ps3: Add gelic udbg driver 2011-09-20 09:20:05 +10:00
sysdev powerpc/xics: Add __init to marker icp_native_init() 2011-09-20 09:20:02 +10:00
xmon powerpc: Remove call sites of MSG_ALL_BUT_SELF 2011-05-19 14:30:46 +10:00
Kconfig powerpc: Hugetlb for BookE 2011-09-20 09:19:40 +10:00
Kconfig.debug powerpc/ps3: Add gelic udbg driver 2011-09-20 09:20:05 +10:00
Makefile Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2011-07-25 22:59:39 -07:00
relocs_check.pl