public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Cohen <wcohen@redhat.com>
To: ananth@in.ibm.com
Cc: SystemTAP <systemtap@sources.redhat.com>,
	akpm@osdl.org, prasanna@in.ibm.com, linux-kernel@vger.kernel.org,
	davem@davemloft.net
Subject: Re: kprobe_handler should  check pre_handler function
Date: Tue, 29 Mar 2005 14:18:02 -0500	[thread overview]
Message-ID: <4249A9EA.10901@redhat.com> (raw)
In-Reply-To: <20050329023408.GA4847@in.ibm.com>

Ananth N Mavinakayanahalli wrote:
> On Mon, Mar 28, 2005 at 04:10:32PM -0500, William Cohen wrote:
> 
> Hi Will,
> 
> 
>>I found kprobes expects there to be a pre_handler function in the 
>>structure. I was writing a probe that only needed a post_handler 
>>function, no pre_handler function. The probe was tracking the 
>>destinations of indirect calls and jumps, the probe needs to fire after 
>>the instruction single steps to get the target address. The probe 
>>crashed the machine because arch/i386/kernel/kprobe.c:kprobe_handler() 
>>blindly calls p->pre_handler().  There should be a check to verify that 
>>the pointer is non-null. There are cases where the pre_handler is not 
>>needed and it would make sense to set it to NULL. Thus, a check should 
>>be done for pre_handler like post_handler and fault_handler.
> 
> 
> You are right. The check for pre_handler is needed and here is a patch
> against 2.6.12-rc1-mm3 that does this.
> 
> Thanks,
> Ananth

Ananth,

Thanks. It looks like it addresses the problem. Could you see about 
getting this patch in the upstream kernel?

-Will



  parent reply	other threads:[~2005-03-29 19:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <424872C8.6080207@redhat.com>
2005-03-29  2:34 ` kprobe_handler should check pre_handler function Ananth N Mavinakayanahalli
2005-03-29  2:54   ` David S. Miller
2005-03-29 19:18   ` William Cohen [this message]
2005-03-29 23:59     ` Ananth N Mavinakayanahalli

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=4249A9EA.10901@redhat.com \
    --to=wcohen@redhat.com \
    --cc=akpm@osdl.org \
    --cc=ananth@in.ibm.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasanna@in.ibm.com \
    --cc=systemtap@sources.redhat.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