From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
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 [thread overview]
Message-ID: <1456330893-19228-6-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1456330893-19228-1-git-send-email-ard.biesheuvel@linaro.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 <ard.biesheuvel@linaro.org>
---
arch/arm64/kernel/insn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.5.0
next prev parent reply other threads:[~2016-02-24 16:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 16:21 [RFC PATCH 0/6] restrict virt_to_page to linear region (instead of __pa) Ard Biesheuvel
2016-02-24 16:21 ` [RFC PATCH 1/6] arm64: vmemmap: use virtual projection of linear region Ard Biesheuvel
2016-02-25 7:02 ` Ard Biesheuvel
2016-02-26 15:15 ` Will Deacon
2016-02-26 15:39 ` Ard Biesheuvel
2016-02-26 16:24 ` Will Deacon
2016-02-26 16:26 ` Ard Biesheuvel
2016-02-24 16:21 ` [RFC PATCH 2/6] arm64: vdso: avoid virt_to_page() translations on kernel symbols Ard Biesheuvel
2016-02-24 16:21 ` [RFC PATCH 3/6] arm64: mm: free __init memory via the linear mapping Ard Biesheuvel
2016-02-24 16:21 ` [RFC PATCH 4/6] arm64: mm: avoid virt_to_page() translation for the zero page Ard Biesheuvel
2016-02-24 16:21 ` Ard Biesheuvel [this message]
2016-02-24 16:21 ` [RFC PATCH 6/6] arm64: mm: disregard PHYS_OFFSET in virt_to_page() Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456330893-19228-6-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).