diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-29 17:06:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-29 17:06:55 -0400 |
commit | 82798a17ad40df827d465329a20ace80497f9b32 (patch) | |
tree | 449ba69dc5a5e19a56b2a9d12d218f9486e5316d /arch/mips/kernel/syscall.c | |
parent | db8185360d91c01f6e482db5ee402c0ad90dec52 (diff) | |
parent | 1a3b7920fe55247d39c3e1ac1e9b8aca607d0188 (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (34 commits)
[MIPS] tb0219: Update copyright message.
[MIPS] MT: Fix bug in multithreaded kernels.
[MIPS] Alchemy: Remove CONFIG_TS_AU1X00_ADS7846 from defconfigs.
Author: Ralf Baechle <ralf@linux-mips.org>
[MIPS] sb1250: Enable GenBus IDE in defconfig.
[MIPS] vmlinux.ld.S: correctly indent .data section
[MIPS] c-r3k: Implement flush_cache_range()
[MIPS] Store sign-extend register values for PTRACE_GETREGS
[MIPS] Alchemy: Register platform devices
[MIPS] Add len and addr validation for MAP_FIXED mappings.
[MIPS] IRIX: Fix off-by-one error in signal compat code.
[MIPS] time: Replace plat_timer_setup with modern APIs.
[MIPS] time: Fix cut'n'paste bug in Sibyte clockevent driver.
[MIPS] time: Make c0_compare_int_usable faster
[MIPS] time: Fix cevt-r4k.c for 64-bit kernel
[MIPS] Sibyte: Delete {sb1250,bcm1480}_steal_irq().
[MIPS] txx9tmr clockevent/clocksource driver
[MIPS] Add mips_hpt_frequency check to mips_clockevent_init().
[MIPS] IP32: Fixes after interrupt renumbering.
[MIPS] IP27: Fix slice logic to work for arbitrary number of slices.
...
Diffstat (limited to 'arch/mips/kernel/syscall.c')
-rw-r--r-- | arch/mips/kernel/syscall.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index b95fe93dd646..af1bdc897488 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -73,7 +73,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
73 | 73 | ||
74 | task_size = STACK_TOP; | 74 | task_size = STACK_TOP; |
75 | 75 | ||
76 | if (len > task_size) | ||
77 | return -ENOMEM; | ||
78 | |||
76 | if (flags & MAP_FIXED) { | 79 | if (flags & MAP_FIXED) { |
80 | /* Even MAP_FIXED mappings must reside within task_size. */ | ||
81 | if (task_size - len < addr) | ||
82 | return -EINVAL; | ||
83 | |||
77 | /* | 84 | /* |
78 | * We do not accept a shared mapping if it would violate | 85 | * We do not accept a shared mapping if it would violate |
79 | * cache aliasing constraints. | 86 | * cache aliasing constraints. |
@@ -83,8 +90,6 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
83 | return addr; | 90 | return addr; |
84 | } | 91 | } |
85 | 92 | ||
86 | if (len > task_size) | ||
87 | return -ENOMEM; | ||
88 | do_color_align = 0; | 93 | do_color_align = 0; |
89 | if (filp || (flags & MAP_SHARED)) | 94 | if (filp || (flags & MAP_SHARED)) |
90 | do_color_align = 1; | 95 | do_color_align = 1; |