From patchwork Wed Feb 24 16:21:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 62802 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2500882lbl; Wed, 24 Feb 2016 08:25:21 -0800 (PST) X-Received: by 10.98.87.80 with SMTP id l77mr55941409pfb.101.1456331121223; Wed, 24 Feb 2016 08:25:21 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 7si5840110pfm.127.2016.02.24.08.25.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2016 08:25:21 -0800 (PST) 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; 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; dkim=neutral (body hash did not verify) header.i=@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 1aYcEA-00077w-MG; Wed, 24 Feb 2016 16:23:50 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYcCZ-0005Vx-ER for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2016 16:22:16 +0000 Received: by mail-wm0-x235.google.com with SMTP id c200so277675135wme.0 for ; Wed, 24 Feb 2016 08:21:50 -0800 (PST) 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=PjtRrARoLF8Rt9R9OuLYqMIU6i3SN9IKjvbxR86amWI=; b=DWubQWRf34dCkHbuKsCjefNdUnAgoMcdFDGDKKkB63tpor0MzbwMsVey6FwvdgpcTF sQbJ3uoKbPKQjLLStZcavLs4bPs6a4N9FGqVA9vb3t1WOiNfqgZOofUu+Bk9GeFnDJ3A 4fTsrSdfgx2twdRE6ZSlV97w5Tno4GKvdHIFc= 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=PjtRrARoLF8Rt9R9OuLYqMIU6i3SN9IKjvbxR86amWI=; b=IHbhlXyDHXWl5V3h5F5Nfr8tixzkuuESch/pNz7F2T9YF528mF0FEClAEocUWl+esG wDysCkUMR85l6/eQHvLzEfoU5p98Rly9WER0Sv50AIqozTuS7Xwemn69E4m2zedYQ/yG 5lBDNjLFGH6XDLrk73eO9Mu4i6zFPc/6gKhFLIgOVnLF9D25ERwOM/vqXSFvbdSEmp8U JdyFLeM/AYoKNchSVpFEyz7lJK1B/r2j6Boa3tdxrLqY2sp1ovv7A1Bn5uzVZDyCY0F5 A2PqMlzo7XYDYbg7WdPpNxUpk0HJ3Dg5pVzpLeeNCyrlFAbusOnpbqvOCjYhpazR212G RQNg== X-Gm-Message-State: AG10YOQdA2/uuFLo8AfYeE2k/lAtfpq36q+6Fw57qd3XoRlLgk92GQFbjcjDtwlfguHsCmLh X-Received: by 10.28.109.150 with SMTP id b22mr26758130wmi.27.1456330909708; Wed, 24 Feb 2016 08:21:49 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id gb9sm3730412wjb.26.2016.02.24.08.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 08:21:48 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com Subject: [RFC PATCH 5/6] kernel: insn: avoid virt_to_page() translations on core kernel symbols Date: Wed, 24 Feb 2016 17:21:32 +0100 Message-Id: <1456330893-19228-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456330893-19228-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456330893-19228-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_082211_999498_E94C61A3 X-CRM114-Status: GOOD ( 11.39 ) 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:235 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_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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, 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..219d3a5df142 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(__pa(addr) >> PAGE_SHIFT); else return addr;