linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [BUG] arm64/hw_breakpoint: trigger breakpoint exception infinitely
Date: Tue, 26 Apr 2016 13:22:13 +0100	[thread overview]
Message-ID: <20160426122212.GN27312@arm.com> (raw)
In-Reply-To: <571F2577.2080203@huawei.com>

On Tue, Apr 26, 2016 at 04:23:19PM +0800, Li Bin wrote:
> This bug can be reproduced by compiling the hw_breakpoint sample
> module that is in the kernel tree, when loading it with parameter
> ksym=nfsdstats, and running nfsstat:
> 
> $ insmod data_breakpoint.ko ksym=nfsdstats
> $ nfsstat
> 
> It will trigger breakpoint exception infinitely:
> 
> nfsdstats value is changed
> ...
> Call trace:
> ...
> Dump stack from sample_hbp_handler
> nfsdstats value is changed
> ...
> Call trace:
> ...
> Dump stack from sample_hbp_handler
> ......
> ......
> 
> This is because that the overflow_handler is set to the callback
> in the module, and in watchpoint_handler, it will not disable the
> breakpoint (and set single step that reenable it), so when exception
> return, it will trigger the breakpoint exception again immediately...

As I explained before, GDB/ptrace *relies* on this behaviour. If you
register an breakpoint overflow handler on arm64, then you need to handle
the step.

Will

  reply	other threads:[~2016-04-26 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26  8:23 [BUG] arm64/hw_breakpoint: trigger breakpoint exception infinitely Li Bin
2016-04-26 12:22 ` Will Deacon [this message]
2016-04-27  2:35   ` Li Bin

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=20160426122212.GN27312@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).