All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
To: Masami Hiramatsu <mhiramat@kernel.org>, Ingo Molnar <mingo@kernel.org>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH -tip v2] kprobes: Prohibit probing on BUG() and WARN() address
Date: Wed, 04 Sep 2019 14:43:26 +0530	[thread overview]
Message-ID: <1567588343.zi51gn8p0w.naveen@linux.ibm.com> (raw)
In-Reply-To: <156750890133.19112.3393666300746167111.stgit@devnote2>

Masami Hiramatsu wrote:
> Since BUG() and WARN() may use a trap (e.g. UD2 on x86) to
> get the address where the BUG() has occurred, kprobes can not
> do single-step out-of-line that instruction. So prohibit
> probing on such address.
> 
> Without this fix, if someone put a kprobe on WARN(), the
> kernel will crash with invalid opcode error instead of
> outputing warning message, because kernel can not find
> correct bug address.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>   Changes in v2:
>    - Add find_bug() stub function for !CONFIG_GENERIC_BUG
>    - Cast the p->addr to unsigned long.
> ---
>  include/linux/bug.h |    5 +++++
>  kernel/kprobes.c    |    3 ++-
>  2 files changed, 7 insertions(+), 1 deletion(-)

Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

- Naveen


  reply	other threads:[~2019-09-04  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 11:08 [PATCH -tip v2] kprobes: Prohibit probing on BUG() and WARN() address Masami Hiramatsu
2019-09-04  9:13 ` Naveen N. Rao [this message]
2019-09-04 12:29 ` Steven Rostedt

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=1567588343.zi51gn8p0w.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.