From patchwork Sat Feb 2 23:44:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 2084831 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 994DCDFB79 for ; Sat, 2 Feb 2013 23:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009Ab3BBXpE (ORCPT ); Sat, 2 Feb 2013 18:45:04 -0500 Received: from mout.gmx.net ([212.227.17.20]:64275 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689Ab3BBXpC (ORCPT ); Sat, 2 Feb 2013 18:45:02 -0500 Received: from mailout-de.gmx.net ([10.1.76.1]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MUiOI-1UTL5V1XKe-00Y8Fj for ; Sun, 03 Feb 2013 00:45:01 +0100 Received: (qmail invoked by alias); 02 Feb 2013 23:45:01 -0000 Received: from p54AD07C7.dip0.t-ipconnect.de (EHLO p100.box) [84.173.7.199] by mail.gmx.net (mp001) with SMTP; 03 Feb 2013 00:45:01 +0100 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX19cOic8wJpcCgeLLHMSTXnR3wJml65lcpTS+8J+/2 53TBbf9+lTlJke Date: Sun, 3 Feb 2013 00:44:59 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH] parisc: ensure that mmapped shared pages are aligned at SHMLBA addresses Message-ID: <20130202234459.GD1188@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Author: John David Anglin Signed-off-by: John David Anglin Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index f76c108..a047b32 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;