Message ID | 1456757084-1078-5-git-send-email-ard.biesheuvel@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1291977lbc; Mon, 29 Feb 2016 06:48:12 -0800 (PST) X-Received: by 10.66.234.166 with SMTP id uf6mr22603794pac.122.1456757292005; Mon, 29 Feb 2016 06:48:12 -0800 (PST) Return-Path: <linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org> Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id t62si43460005pfa.211.2016.02.29.06.48.11 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 06:48:11 -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 1aaP6Q-0004Pd-Jw; Mon, 29 Feb 2016 14:47:14 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaP57-0003Pg-CJ for linux-arm-kernel@lists.infradead.org; Mon, 29 Feb 2016 14:45:55 +0000 Received: by mail-wm0-x233.google.com with SMTP id l68so40028888wml.0 for <linux-arm-kernel@lists.infradead.org>; Mon, 29 Feb 2016 06:45:34 -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=Ihu6CkUIvc+279OJuZ30w2ynCxiYYF4zn5wHOkHq4jTntkgLJcRy6ZGevNi3u2+a19 /TOn5a6c33ObyjKYv6FsVOVLaVmWXgu7hnptw2yg5vDG0RYANDbhI/orYGR8mpcve91A 2pgMgKdme+ShwAza51qP4vJtAT4S8qrENMkN0= 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=GykM51gXkjB+o/FbDGlAQQR5gMeUFkxshqY2ETJcfXtCLgeOS8Aztt2meTrY+ugh6s /gD8oA/AVAqUjVBPQpsmMWlKgkV/2xKGqwcxaD9OXENsMa1urSrGyOXRdzzJ7pOYipWE JfVafQ57POxcvfP6X++KIRT+ATwFz89+uAgwdMReKTreDBf6LAAQnl07PxspXvOi9jN2 8qIOiQ1pDw9rz1qWYF5Oy603oxU+V2FU5g6OQMWmsWJo7BDTKt4mRtWzJtBGl0w9sGPA 1yvKaXcaEwFIxMFnl+QC2xo2xtMWmE/qR8Tjbv7pfklg49/ncTkywTo46Qa3rG6VVcNL tdkA== X-Gm-Message-State: AD7BkJIwL4xMi5UCN2Ah+tWThcLwcujQKLDh4esKYvKTw8EYIYVIMVzmn+Yjl3nybqMe/n9A X-Received: by 10.28.9.19 with SMTP id 19mr12713113wmj.87.1456757133424; Mon, 29 Feb 2016 06:45:33 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id di1sm26196693wjc.3.2016.02.29.06.45.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 06:45:32 -0800 (PST) From: Ard Biesheuvel <ard.biesheuvel@linaro.org> To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com Subject: [PATCH v2 4/9] arm64: insn: avoid virt_to_page() translations on core kernel symbols Date: Mon, 29 Feb 2016 15:44:39 +0100 Message-Id: <1456757084-1078-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456757084-1078-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456757084-1078-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_064553_746301_70ED91D6 X-CRM114-Status: GOOD ( 11.46 ) 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:233 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_AU Message has a valid DKIM or DK signature from author's domain 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: jonas@southpole.se, Ard Biesheuvel <ard.biesheuvel@linaro.org>, linux-mm@kvack.org, nios2-dev@lists.rocketboards.org, linux@lists.openrisc.net, lftan@altera.com, akpm@linux-foundation.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org |
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;
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 <ard.biesheuvel@linaro.org> --- 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