[lkml]   [2005]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: kprobe_handler should check pre_handler function
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


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


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-04-06 13:31    [W:0.060 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site