From: Masami Hiramatsu <mhiramat@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
Wang Nan <wangnan0@huawei.com>, Will Deacon <will.deacon@arm.com>,
Jon Medhurst <tixy@linaro.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, David Long <dave.long@linaro.org>
Subject: Re: [PATCH 2/2] arm: kprobes: Prohibit kprobes on get_user functions
Date: Sun, 25 Feb 2018 21:21:18 +0900 [thread overview]
Message-ID: <20180225212118.ee09db43772a338151762730@kernel.org> (raw)
In-Reply-To: <151945939903.11045.1486072728379559979.stgit@devbox>
On Sat, 24 Feb 2018 17:03:19 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:
> Since do_undefinstr() uses get_user to get the undefined
> instruction, it can be called before kprobes processes
> recursive check. This can cause an infinit recursive
> exception.
> Prohibit probing on get_user functions.
>
> Fixes: 24ba613c9d6c ("ARM kprobes: core code")
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> arch/arm/include/asm/assembler.h | 8 ++++++++
> arch/arm/lib/getuser.S | 10 ++++++++++
> 2 files changed, 18 insertions(+)
>
> diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
> index bc8d4bbd82e2..dd5e7f30eaed 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -536,4 +536,12 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
> #endif
> .endm
>
> +#ifdef CONFIG_KPROBES
> +# define _ASM_NOKPROBE(entry) \
> + .pushsection "_kprobe_blacklist", "aw" ; \
> + .balign 4 ; \
> + .long entry; \
> + .popsection
Oops, I missed #else block... which cause build error if !CONFIG_KPROBES.
I'll update it soon.
Thanks,
--
Masami Hiramatsu <mhiramat@kernel.org>
prev parent reply other threads:[~2018-02-25 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 8:02 [PATCH 1/2] arm: kprobes: Prohibit kprobes on do_undefinstr Masami Hiramatsu
2018-02-24 8:03 ` [PATCH 2/2] arm: kprobes: Prohibit kprobes on get_user functions Masami Hiramatsu
2018-02-25 10:09 ` kbuild test robot
2018-02-25 10:12 ` kbuild test robot
2018-02-25 12:21 ` Masami Hiramatsu [this message]
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=20180225212118.ee09db43772a338151762730@kernel.org \
--to=mhiramat@kernel.org \
--cc=dave.long@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=tixy@linaro.org \
--cc=wangnan0@huawei.com \
--cc=will.deacon@arm.com \
/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
Powered by JetHome