All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG kretprobes] kretprobe triggers General Protection Faults
Date: Wed, 26 Feb 2014 11:48:13 +0900	[thread overview]
Message-ID: <530D55ED.4060903@hitachi.com> (raw)
In-Reply-To: <1332921457.30140.1393357561516.JavaMail.zimbra@efficios.com>

Hi Mathieu,

(2014/02/26 4:46), Mathieu Desnoyers wrote:
> Hi,
> 
> I had a bug report[1] from a user trying to add a kretprobe on the system
> call entry code path:
> 
> arch/x86/kernel/entry_64.S:
> 
> ffffffff813dffe2 <system_call_fastpath+0x16>:
>         cmpl $__NR_syscall_max,%eax
> #endif
>         ja badsys
>         movq %r10,%rcx
>         call *sys_call_table(,%rax,8)  # XXX:    rip relative
>         movq %rax,RAX-ARGOFFSET(%rsp)   <--- return address pointing here

Hm, I guess you put kretprobes on the functions on the sys_call_table,
right?

> And all hell breaks loose (various types of faults, machine reboots,
> applications exit randomly, etc.). I understand that this code path
> is not marked as unsafe against kprobes, and I tested that a kprobes
> indeed works fine there. However, kretprobes probably presumes a function
> stack layout that is just not valid for the syscall entry routine.

All the syscall entry functions caused this issue? or some
specific function(s) ?
And could you tell me the kernel version you used?

> Any thoughts on how kretprobes should handle this ?

I'll try to reproduce it in kvm environment.

Thank you!

-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



      reply	other threads:[~2014-02-26  2:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1164803689.30103.1393357052243.JavaMail.zimbra@efficios.com>
2014-02-25 19:46 ` [BUG kretprobes] kretprobe triggers General Protection Faults Mathieu Desnoyers
2014-02-26  2:48   ` 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=530D55ED.4060903@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --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.