linux/arch
Brian King 48f797de55 powerpc: Check for valid hugepage size in hugetlb_get_unmapped_area
It looks like most of the hugetlb code is doing the correct thing if
hugepages are not supported, but the mmap code is not.  If we get into
the mmap code when hugepages are not supported, such as in an LPAR
which is running Active Memory Sharing, we can oops the kernel.  This
fixes the oops being seen in this path.

oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=1024 NUMA pSeries
Modules linked in: nfs(N) lockd(N) nfs_acl(N) sunrpc(N) ipv6(N) fuse(N) loop(N)
dm_mod(N) sg(N) ibmveth(N) sd_mod(N) crc_t10dif(N) ibmvscsic(N)
scsi_transport_srp(N) scsi_tgt(N) scsi_mod(N)
Supported: No
NIP: c000000000038d60 LR: c00000000003945c CTR: c0000000000393f0
REGS: c000000077e7b830 TRAP: 0300   Tainted: G
(2.6.27.5-bz50170-2-ppc64)
MSR: 8000000000009032 <EE,ME,IR,DR>  CR: 44000448  XER: 20000001
DAR: c000002000af90a8, DSISR: 0000000040000000
TASK = c00000007c1b8600[4019] 'hugemmap01' THREAD: c000000077e78000 CPU: 6
GPR00: 0000001fffffffe0 c000000077e7bab0 c0000000009a4e78 0000000000000000
GPR04: 0000000000010000 0000000000000001 00000000ffffffff 0000000000000001
GPR08: 0000000000000000 c000000000af90c8 0000000000000001 0000000000000000
GPR12: 000000000000003f c000000000a73880 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000010000
GPR20: 0000000000000000 0000000000000003 0000000000010000 0000000000000001
GPR24: 0000000000000003 0000000000000000 0000000000000001 ffffffffffffffb5
GPR28: c000000077ca2e80 0000000000000000 c00000000092af78 0000000000010000
NIP [c000000000038d60] .slice_get_unmapped_area+0x6c/0x4e0
LR [c00000000003945c] .hugetlb_get_unmapped_area+0x6c/0x80
Call Trace:
[c000000077e7bbc0] [c00000000003945c] .hugetlb_get_unmapped_area+0x6c/0x80
[c000000077e7bc30] [c000000000107e30] .get_unmapped_area+0x64/0xd8
[c000000077e7bcb0] [c00000000010b140] .do_mmap_pgoff+0x140/0x420
[c000000077e7bd80] [c00000000000bf5c] .sys_mmap+0xc4/0x140
[c000000077e7be30] [c0000000000086b4] syscall_exit+0x0/0x40
Instruction dump:
fac1ffb0 fae1ffb8 fb01ffc0 fb21ffc8 fb41ffd0 fb61ffd8 fb81ffe0 fbc1fff0
fbe1fff8 f821fef1 f8c10158 f8e10160 <7d49002e> f9010168 e92d01b0 eb4902b0

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-12-16 13:48:18 +11:00
..
alpha alpha: pcibios_resource_to_bus() is callable from normal code 2008-11-30 10:03:37 -08:00
arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2008-12-09 08:29:31 -08:00
avr32
blackfin Blackfin arch: fix a broken define in dma-mapping 2008-11-18 17:48:22 +08:00
cris [CRIS] Remove links from CRIS build 2008-10-31 23:37:57 +01:00
frv frv: fix mmap2 error handling 2008-12-01 19:55:24 -08:00
h8300
ia64 [IA64] SN: prevent IRQ retargetting in request_irq() 2008-12-09 10:57:18 -08:00
m32r m32r: section noise in head.S 2008-11-30 10:03:37 -08:00
m68k m68k: Update defconfigs for 2.6.28-rc7 2008-12-02 20:58:26 +01:00
m68knommu
mips MIPS: IP32: Update defconfig 2008-12-12 18:12:23 +00:00
mn10300 MN10300: Give correct size when reserving interrupt vector table 2008-12-10 13:34:33 -08:00
parisc Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6 2008-11-30 14:04:31 -08:00
powerpc powerpc: Check for valid hugepage size in hugetlb_get_unmapped_area 2008-12-16 13:48:18 +11:00
s390 Merge branch 'kvm-updates/2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm 2008-12-02 15:56:17 -08:00
sh serial: sh-sci: Reorder the SCxTDR write after the TDxE clear. 2008-11-13 17:46:06 +09:00
sparc sparc: asm/bitops.h should define __fls 2008-12-03 16:04:52 -08:00
sparc64 sparc64: Sync FPU state in VIS emulation handler. 2008-12-04 09:12:57 -08:00
um uml: boot broken due to buffer overrun 2008-12-10 08:01:52 -08:00
x86 x86 Fix VMI crash on boot in 2.6.28-rc8 2008-12-14 16:24:38 -08:00
xtensa
.gitignore
Kconfig remove __ARCH_WANT_COMPAT_SYS_PTRACE 2008-11-30 11:00:15 -08:00