diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-05 23:10:44 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 14:44:59 +0300 |
commit | e77414e0aad6a1b063ba5e5750c582c75327ea6a (patch) | |
tree | 9492b584ce6a3e4f99570ce4517d7efaaff4fb93 /arch/arm/mm/mmap.c | |
parent | bb52d6694002b9d632bb355f64daa045c6293a4e (diff) | |
download | linux-e77414e0aad6a1b063ba5e5750c582c75327ea6a.tar.xz |
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/arm/mm/mmap.c')
-rw-r--r-- | arch/arm/mm/mmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index 2b7996401b0f..f5abc51c5a07 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c @@ -54,7 +54,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, * We enforce the MAP_FIXED case. */ if (flags & MAP_FIXED) { - if (aliasing && flags & MAP_SHARED && addr & (SHMLBA - 1)) + if (aliasing && flags & MAP_SHARED && + (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)) return -EINVAL; return addr; } |