From 5ca8b91df88fa417aa7aac19494a8ae1602db2cb Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 2 Feb 2013 23:44:59 +0000 Subject: [PATCH] parisc: ensure that mmapped shared pages are aligned at SHMLBA addresses Signed-off-by: John David Anglin Signed-off-by: Helge Deller --- arch/parisc/kernel/sys_parisc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index f76c10863c62..a047b3227e50 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c @@ -94,11 +94,12 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, { if (len > TASK_SIZE) return -ENOMEM; - /* Might want to check for cache aliasing issues for MAP_FIXED case - * like ARM or MIPS ??? --BenH. - */ - if (flags & MAP_FIXED) + if (flags & MAP_FIXED) { + if ((flags & MAP_SHARED) && + (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)) + return -EINVAL; return addr; + } if (!addr) addr = TASK_UNMAPPED_BASE; -- 2.39.5