diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-05 21:10:44 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 12:44:59 +0100 |
commit | e77414e0aad6a1b063ba5e5750c582c75327ea6a (patch) | |
tree | 9492b584ce6a3e4f99570ce4517d7efaaff4fb93 /arch/mips | |
parent | Get rid of open-coding in ia64_brk() (diff) | |
download | linux-e77414e0aad6a1b063ba5e5750c582c75327ea6a.tar.xz linux-e77414e0aad6a1b063ba5e5750c582c75327ea6a.zip |
fix broken aliasing checks for MAP_FIXED on sparc32, mips, arm and sh
We want addr - (pgoff << PAGE_SHIFT) consistently coloured...
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/syscall.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index c25b2e7dcb7b..3f7f466190b4 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -93,7 +93,8 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, * We do not accept a shared mapping if it would violate * cache aliasing constraints. */ - if ((flags & MAP_SHARED) && (addr & shm_align_mask)) + if ((flags & MAP_SHARED) && + ((addr - (pgoff << PAGE_SHIFT)) & shm_align_mask)) return -EINVAL; return addr; } |