From: mhiramat@kernel.org (Masami Hiramatsu)
To: linux-arm-kernel@lists.infradead.org
Subject: [BUGFIX PATCH v3 3/4] arm: kprobes: Prohibit kprobes on do_undefinstr
Date: Fri, 4 May 2018 13:15:58 +0900 [thread overview]
Message-ID: <152540735813.29650.10807161581632067171.stgit@devbox> (raw)
In-Reply-To: <152540727123.29650.13679359124038587629.stgit@devbox>
Prohibit kprobes on do_undefinstr because kprobes on
arm is implemented by undefined instruction. This means
if we probe do_undefinstr(), it can cause infinit
recursive exception.
Fixes: 24ba613c9d6c ("ARM kprobes: core code")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: stable at vger.kernel.org
---
arch/arm/kernel/traps.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 5e3633c24e63..2fe87109ae46 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -19,6 +19,7 @@
#include <linux/uaccess.h>
#include <linux/hardirq.h>
#include <linux/kdebug.h>
+#include <linux/kprobes.h>
#include <linux/module.h>
#include <linux/kexec.h>
#include <linux/bug.h>
@@ -417,7 +418,8 @@ void unregister_undef_hook(struct undef_hook *hook)
raw_spin_unlock_irqrestore(&undef_lock, flags);
}
-static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
+static nokprobe_inline
+int call_undef_hook(struct pt_regs *regs, unsigned int instr)
{
struct undef_hook *hook;
unsigned long flags;
@@ -490,6 +492,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6);
}
+NOKPROBE_SYMBOL(do_undefinstr)
/*
* Handle FIQ similarly to NMI on x86 systems.
next prev parent reply other threads:[~2018-05-04 4:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 4:14 [BUGFIX PATCH v3 0/4] arm: kprobes: Fix to prohibit probing on unsafe functions Masami Hiramatsu
2018-05-04 4:15 ` [BUGFIX PATCH v3 1/4] arm: kprobes: Fix to use get_kprobe_ctlblk after irq-disabed Masami Hiramatsu
2018-05-04 4:15 ` [BUGFIX PATCH v3 2/4] arm: kprobes: Prohibit probing on optimized_callback Masami Hiramatsu
2018-05-04 4:15 ` Masami Hiramatsu [this message]
2018-05-04 4:16 ` [BUGFIX PATCH v3 4/4] arm: kprobes: Prohibit kprobes on get_user functions Masami Hiramatsu
2018-05-08 11:25 ` [BUGFIX PATCH v3 0/4] arm: kprobes: Fix to prohibit probing on unsafe functions Russell King - ARM Linux
2018-05-12 0:42 ` Masami Hiramatsu
2018-05-12 4:31 ` Greg KH
2018-05-12 9:06 ` Russell King - ARM Linux
2018-05-12 11:31 ` Masami Hiramatsu
2018-05-12 17:29 ` Florian Fainelli
2018-05-13 1:55 ` Masami Hiramatsu
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=152540735813.29650.10807161581632067171.stgit@devbox \
--to=mhiramat@kernel.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).