* [PATCH 19/19] fix broken aliasing checks for MAP_FIXED on sparc32, mips, arm and sh
@ 2009-12-07 3:55 Al Viro
2009-12-08 7:17 ` Paul Mundt
0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2009-12-07 3:55 UTC (permalink / raw)
To: linux-arch; +Cc: torvalds, linux-kernel
We want addr - (pgoff << PAGE_SHIFT) consistently coloured...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
[MIPS part is in arch tree already]
arch/arm/mm/mmap.c | 3 ++-
arch/mips/kernel/syscall.c | 3 ++-
arch/sh/mm/mmap.c | 3 ++-
arch/sparc/kernel/sys_sparc_32.c | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index 2b79964..f5abc51 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;
}
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index c25b2e7..3f7f466 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;
}
diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
index d2984fa..afeb710 100644
--- a/arch/sh/mm/mmap.c
+++ b/arch/sh/mm/mmap.c
@@ -54,7 +54,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;
}
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
index 997bdd0..3a82e65 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;
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 19/19] fix broken aliasing checks for MAP_FIXED on sparc32, mips, arm and sh
2009-12-07 3:55 [PATCH 19/19] fix broken aliasing checks for MAP_FIXED on sparc32, mips, arm and sh Al Viro
@ 2009-12-08 7:17 ` Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2009-12-08 7:17 UTC (permalink / raw)
To: Al Viro; +Cc: linux-arch, torvalds, linux-kernel
On Mon, Dec 07, 2009 at 03:55:01AM +0000, Al Viro wrote:
>
> We want addr - (pgoff << PAGE_SHIFT) consistently coloured...
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> [MIPS part is in arch tree already]
> arch/arm/mm/mmap.c | 3 ++-
> arch/mips/kernel/syscall.c | 3 ++-
> arch/sh/mm/mmap.c | 3 ++-
> arch/sparc/kernel/sys_sparc_32.c | 3 ++-
> 4 files changed, 8 insertions(+), 4 deletions(-)
>
Acked-by: Paul Mundt <lethal@linux-sh.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-08 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07 3:55 [PATCH 19/19] fix broken aliasing checks for MAP_FIXED on sparc32, mips, arm and sh Al Viro
2009-12-08 7:17 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox