From patchwork Mon May 4 02:52:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hillf Danton X-Patchwork-Id: 6322671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C07C99F32B for ; Mon, 4 May 2015 02:55:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5A902038D for ; Mon, 4 May 2015 02:55:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31C9A20381 for ; Mon, 4 May 2015 02:55:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yp6VG-0000mT-GC; Mon, 04 May 2015 02:53:06 +0000 Received: from out4133-18.mail.aliyun.com ([42.120.133.18]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yp6VC-0000i7-Rp for linux-arm-kernel@lists.infradead.org; Mon, 04 May 2015 02:53:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1430707958; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=iKPFyX/wddQzjrS4qod9otH9Vjt6/YgG2u70vtC5kDU=; b=RWArh0cygd/SztBgHvj3wmDEWBV/ZoUiptqrfnMEjvUKgRgPpxAipqQRl0HERMPi+gFCAbk73eYA7QP/0BAiecZ4huW4oKuiSDYpnpSB85WGktkqR73mpqNO7jb/2iPNmb+wTtSFzBf/+NCC7gN8HoGamF4fT2S1oNyxVhr7vh8= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R101e4; FP=0|-1|-1|-1|0|-1|-1|-1; HT=r41g03043; MF=hillf.zj@alibaba-inc.com; PH=DS; RN=4; RT=4; SR=0; Received: from ali074300n(mailfrom:hillf.zj@alibaba-inc.com ip:182.92.253.16) by smtp.aliyun-inc.com(127.0.0.1); Mon, 04 May 2015 10:52:32 +0800 From: "Hillf Danton" To: "'Laura Abbott'" References: <042801d066b3$0ca78a30$25f69e90$@alibaba-inc.com> <5543C529.4080203@labbott.name> In-Reply-To: <5543C529.4080203@labbott.name> Subject: [patch] ARM: fix module-bound check in setting page attributes Date: Mon, 04 May 2015 10:52:31 +0800 Message-ID: <019401d08615$5e093000$1a1b9000$@alibaba-inc.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKWkNKu4FurPqc1WAFJ+6S68oSOowHpVX6Sm8+6L9A= Content-Language: zh-cn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150503_195303_101051_A75E6574 X-CRM114-Status: UNSURE ( 3.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) Cc: 'Russell King' , 'linux-kernel' , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Hillf Danton Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It was introduced in commit f2ca09f381a59 (ARM: 8311/1: Don't use is_module_addr in setting page attributes) We have no need to check start twice, but see if end is also in range. Signed-off-by: Hillf Danton Acked-by: Laura Abbott --- -- --- a/arch/arm/mm/pageattr.c Mon May 4 10:33:49 2015 +++ b/arch/arm/mm/pageattr.c Mon May 4 10:35:32 2015 @@ -52,7 +52,7 @@ static int change_memory_common(unsigned if (start < MODULES_VADDR || start >= MODULES_END) return -EINVAL; - if (end < MODULES_VADDR || start >= MODULES_END) + if (end < MODULES_VADDR || end >= MODULES_END) return -EINVAL; data.set_mask = set_mask;