diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-05 15:10:44 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:44:59 -0500 |
commit | e77414e0aad6a1b063ba5e5750c582c75327ea6a (patch) | |
tree | 9492b584ce6a3e4f99570ce4517d7efaaff4fb93 /arch/sparc | |
parent | bb52d6694002b9d632bb355f64daa045c6293a4e (diff) | |
download | linux-stable-e77414e0aad6a1b063ba5e5750c582c75327ea6a.tar.gz linux-stable-e77414e0aad6a1b063ba5e5750c582c75327ea6a.tar.bz2 linux-stable-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/sparc')
-rw-r--r-- | arch/sparc/kernel/sys_sparc_32.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c index 997bdd0d3d70..3a82e65d8db2 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c @@ -45,7 +45,8 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi /* We do not accept a shared mapping if it would violate * cache aliasing constraints. */ - if ((flags & MAP_SHARED) && (addr & (SHMLBA - 1))) + if ((flags & MAP_SHARED) && + ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))) return -EINVAL; return addr; } |