android_kernel_xiaomi_sm8350/arch
David Daney 098362e720 [MIPS] Add len and addr validation for MAP_FIXED mappings.
Mmap with MAP_FIXED was not validating the addr and len parameters.  This
leads to the failure of GCC's gcc.c-torture/execute/loop-2[fg].c testcases
when using the o32 ABI on a 64 bit kernel.

These testcases try to mmap 65536 bytes at 0x7fff8000 and then access all
the memory.  In 2.6.18 and 2.6.23.1 (and likely other versions as well)
the kernel maps the requested memory, but since half of it is above
0x80000000 a SIGBUS is generated when it is accessed.

This patch moves the len validation above the MAP_FIXED processing so that
it is always validated.  It also adds validation to the addr parameter for
MAP_FIXED mappings.

Signed-off-by: David Daney  <ddaney@avtrex.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2007-10-29 19:35:36 +00:00
..
alpha alpha: sg_virt() fallout 2007-10-23 12:31:05 +02:00
arm Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2007-10-23 16:32:11 -07:00
avr32 [AVR32] ARRAY_SIZE() cleanup 2007-10-23 11:20:26 +02:00
blackfin blackfin: fix sg fallout 2007-10-24 14:09:25 +02:00
cris typo fixes 2007-10-20 01:34:40 +02:00
frv scatterlist fallout: frv 2007-10-27 22:18:11 -07:00
h8300 spelling fixes: arch/h8300/ 2007-10-20 01:10:46 +02:00
ia64 Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block 2007-10-22 19:11:06 -07:00
m32r spelling fixes: arch/m32r/ 2007-10-20 01:14:39 +02:00
m68k m68k: sg fallout 2007-10-24 08:55:40 +02:00
m68knommu m68knommu: mark mem init functions as __init 2007-10-23 20:45:44 -07:00
mips [MIPS] Add len and addr validation for MAP_FIXED mappings. 2007-10-29 19:35:36 +00:00
parisc parisc: fix sg_page() fallout 2007-10-23 09:49:31 +02:00
powerpc Merge branch 'for-2.6.24' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx into merge 2007-10-23 22:20:51 +10:00
ppc kbuild: restore arch/{ppc/xtensa}/boot cflags 2007-10-20 20:35:23 +02:00
s390 [S390] 4level-fixup cleanup 2007-10-22 12:52:49 +02:00
sh Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
sh64 Fix misspellings of "system", "controller", "interrupt" and "necessary". 2007-10-19 23:10:43 +02:00
sparc [SPARC32]: Fix build-warning in io-unit.c 2007-10-27 00:54:14 -07:00
sparc64 [SPARC64]: __inline__ --> inline 2007-10-27 00:13:04 -07:00
um arch/um/drivers/ubd_kern.c: fix a building error 2007-10-24 13:07:11 +02:00
v850 spelling fixes: arch/v850/ 2007-10-20 01:24:05 +02:00
x86 x86: Dump filtering supports x86_64 sparsemem 2007-10-27 20:57:43 +02:00
xtensa kbuild: restore arch/{ppc/xtensa}/boot cflags 2007-10-20 20:35:23 +02:00