Re: [PATCH 2.6.27-rc1-git5 2/26] mdb: correct kprobes int3 trap

From: Abhishek Sagar
Date: Wed Aug 06 2008 - 08:23:21 EST


On Tue, Aug 5, 2008 at 11:56 AM, <jmerkey@xxxxxxxxxxxxxxxxxxxxx> wrote:
> @@ -850,6 +871,10 @@
> #ifdef CONFIG_KPROBES
> void __kprobes do_int3(struct pt_regs *regs, long error_code)
> {
> +#ifdef CONFIG_MDB
> + if (mdb(BREAKPOINT_EXCEPTION, error_code, regs))
> + return;
> +#endif // CONFIG_MDB
> trace_hardirqs_fixup();
>
> if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
> @@ -865,6 +890,16 @@
> }
> #endif

If the mdb() call modifies the IF flag in regs, then it should
probably be called after trace_hardirqs_fixup. Best to keep it behind
notify_die() ensuring that kprobes handles all breakpoints first.
Otherwise at least the mdb function (and others in its call chain)
should be marked as __kprobes.

-- Abhishek Sagar
--
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/