Re: [PATCH] kmemcheck: move hook before preempt_conditional_sti()

From: Masami Hiramatsu
Date: Mon Jun 08 2009 - 15:44:23 EST


Ananth N Mavinakayanahalli wrote:
> On Sun, Jun 07, 2009 at 06:26:52PM +0200, Vegard Nossum wrote:
>> commit 787ecfaa503dc63ff1831ddc74b15dad49bace1d
>> Author: Vegard Nossum <vegard.nossum@xxxxxxxxx>
>> Date: Fri Apr 4 00:53:23 2008 +0200
>>
>> x86: add hooks for kmemcheck
>>
>> I encourage the kprobe developers to check whether their code is correct
>> as it stands in current tip/master. Also, comments on this particular
>> change is welcome.
>
> I see no problem with this change wrt kprobes, since the changes happen
> after the notify_die, by which time, kprobes would've returned
> NOTIFY_DONE since the per-cpu current_kprobe == NULL.

BTW, what will happen if kmemchecked page is accessed from
kprobe's single-stepping instruction? :-)

If a pagefault occurs before (kprobe's)single-step is done,
may kmemcheck's single-step handler be ignored by kprobe's
single-step handler? If it's true, I think kmemcheck hook
should be done before notify_die. (and add __kprobes to some
kmemcheck functions)

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@xxxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/