From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm64: kprobes: Remove unneeded address sanity check
Date: Tue, 6 Feb 2018 14:36:17 +0000 [thread overview]
Message-ID: <20180206143617.GF22740@arm.com> (raw)
In-Reply-To: <20180201093459.20477-2-takahiro.akashi@linaro.org>
On Thu, Feb 01, 2018 at 06:34:58PM +0900, AKASHI Takahiro wrote:
> From: Masami Hiramatsu <mhiramat@kernel.org>
>
> Remove unneeded address sanity check in arch_prepare_kprobe().
> Since do_debug_exception() is already blacklisted for kprobes, no need
> to reject all __exception functions. Also, since generic kprobe
> framework already ensures the address is in kernel text, no need to
> check it is in rodata again.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Reported-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
> arch/arm64/kernel/probes/kprobes.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d849d9804011..3c487a389252 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -78,8 +78,6 @@ static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs)
> int __kprobes arch_prepare_kprobe(struct kprobe *p)
> {
> unsigned long probe_addr = (unsigned long)p->addr;
> - extern char __start_rodata[];
> - extern char __end_rodata[];
>
> if (probe_addr & 0x3)
> return -EINVAL;
> @@ -87,12 +85,6 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> /* copy instruction */
> p->opcode = le32_to_cpu(*p->addr);
>
> - if (in_exception_text(probe_addr))
> - return -EINVAL;
> - if (probe_addr >= (unsigned long) __start_rodata &&
> - probe_addr <= (unsigned long) __end_rodata)
> - return -EINVAL;
> -
Does this mean we can remove in_exception_text and the corresponding
__exception annotations from arm64?
Will
next prev parent reply other threads:[~2018-02-06 14:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 9:34 [PATCH 0/2] lkdtm: fix irq handler entry for arm64 AKASHI Takahiro
2018-02-01 9:34 ` [PATCH 1/2] arm64: kprobes: Remove unneeded address sanity check AKASHI Takahiro
2018-02-06 14:36 ` Will Deacon [this message]
2018-02-07 0:02 ` Masami Hiramatsu
2018-02-15 2:08 ` David Long
2018-02-15 6:47 ` Masami Hiramatsu
2018-02-22 5:19 ` David Long
2018-02-22 5:45 ` Masami Hiramatsu
2018-02-01 9:34 ` [PATCH 2/2] lkdtm: fix irq handler entry for arm64 AKASHI Takahiro
2018-02-27 3:57 ` Kees Cook
2018-02-27 5:07 ` Masami Hiramatsu
2018-02-27 7:20 ` AKASHI Takahiro
2018-02-27 15:46 ` Kees Cook
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=20180206143617.GF22740@arm.com \
--to=will.deacon@arm.com \
--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).