Re: WARNING in arch_uprobe_analyze_insn

From: Oleg Nesterov
Date: Tue May 15 2018 - 13:41:16 EST


On 05/15, Masami Hiramatsu wrote:
>
> On Tue, 15 May 2018 15:36:30 +0200
> Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> > Unfortunately, insn_get_length() returns void, and I do not see any
> > insn-was-decoded-correctly helper. Perhaps we should simply remove
> > this WARN_ON() ?
>
> Yes, it should just return an error,

OK, I'll send the fix,

> since user can miss the
> probe address on user binary and we can not make sure
> that is on a instruction boundary.

Or this insn is actually invalid.

> > Alternatively, If am right we can move this check down after the "good_insns"
> > checks, but this doesn't look very clean to me.
>
> I think it is enough if arch_uprobe_analyze_insn() returns an error.
> That makes prepare_uprobe() fail and finally leads uprobe_register()
> fail.

I meant that this way we could probably keep WARN_ON(). Nevermind.

Thanks!

Oleg.