From patchwork Wed Mar 30 14:45:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64708 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2639550lbc; Wed, 30 Mar 2016 07:48:55 -0700 (PDT) X-Received: by 10.98.71.156 with SMTP id p28mr13794170pfi.139.1459349335411; Wed, 30 Mar 2016 07:48:55 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id lf12si6949118pab.207.2016.03.30.07.48.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Mar 2016 07:48:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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 1alHPU-0000j0-Ao; Wed, 30 Mar 2016 14:47:52 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alHOO-00087J-1i for linux-arm-kernel@lists.infradead.org; Wed, 30 Mar 2016 14:46:45 +0000 Received: by mail-wm0-x22d.google.com with SMTP id r72so102915532wmg.0 for ; Wed, 30 Mar 2016 07:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0867VHfJyz/tYwuwKrmex1+tpX6zxm1g8lVQBge7lCY=; b=OoQk/rGdr1NXytNSGnpCVUupBIrtAhwlO9NWyfJ/+2cRwZM0ckpEZLoV0fT/tfEO3m pB+dRPf9Xqlae/aqen05Z3glTnDnYMl1B1iSlEdueF+Ultj/bnw8szYBKb8Dlx96RwKm +I2+aW4fwvzioFr7EdvEDGki9AFpZMoVs73BQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0867VHfJyz/tYwuwKrmex1+tpX6zxm1g8lVQBge7lCY=; b=IuyGqfG8NoqQG6EuRNCPmHVtHCQtu1CG40FJgMHTDH+SSM1L3rvRzI2suAcMS6+epT inj5W46+u6gFUH8+l16odwCXXGLTh+S3cL4YXLiHeyDrvPrpxwV96mnaLDtoXQBQ5/XB KTTSD++VT0HUrfXQ1yycPEMsutdTRLNp5GQMS1mXDqF/737TNSVWvPFfu4MnHpNeSVho 1CZ88Ux3T86xz8IGRPf1iSZD5Hiyp7yQIWC6OxSwEXqLbD86SfUnq0PBhAwlpaVU6lmw bt2lTwEsAkem5XQEhorSfnCFRGs+vXeRbOmL0QDwyGuzh8T9lwYOj9r3TiGUoj8gEILG uM+w== X-Gm-Message-State: AD7BkJJW8FHXYD+YcvW6xRYefxwUkI4CrWaRPTTgHvVJ0Z8hDr7AAVMtazZVWOpZK40bDp1Z X-Received: by 10.194.205.138 with SMTP id lg10mr9925647wjc.153.1459349182705; Wed, 30 Mar 2016 07:46:22 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id i5sm4325336wjx.15.2016.03.30.07.46.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Mar 2016 07:46:22 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mm@kvack.org, akpm@linux-foundation.org, nios2-dev@lists.rocketboards.org, lftan@altera.com, jonas@southpole.se, linux@lists.openrisc.net Subject: [PATCH v2 4/9] arm64: insn: avoid virt_to_page() translations on core kernel symbols Date: Wed, 30 Mar 2016 16:45:59 +0200 Message-Id: <1459349164-27175-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459349164-27175-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459349164-27175-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160330_074644_522636_A65BA5DB X-CRM114-Status: GOOD ( 11.42 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, steve.capper@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Before restricting virt_to_page() to the linear mapping, ensure that the text patching code does not use it to resolve references into the core kernel text, which is mapped in the vmalloc area. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/insn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index 7371455160e5..368c08290dd8 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -96,7 +96,7 @@ static void __kprobes *patch_map(void *addr, int fixmap) if (module && IS_ENABLED(CONFIG_DEBUG_SET_MODULE_RONX)) page = vmalloc_to_page(addr); else if (!module && IS_ENABLED(CONFIG_DEBUG_RODATA)) - page = virt_to_page(addr); + page = pfn_to_page(PHYS_PFN(__pa(addr))); else return addr;