public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	syzbot <syzbot+30d675e3ca03c1c351e7@syzkaller.appspotmail.com>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] uprobes/x86: remove the wrong WARN_ON() in uprobe_init_insn()
Date: Sat, 19 May 2018 08:58:48 +0900	[thread overview]
Message-ID: <20180519085848.e2b0be1ed752e3e35b7ba0ab@kernel.org> (raw)
In-Reply-To: <20180518162739.GA5559@redhat.com>

On Fri, 18 May 2018 18:27:39 +0200
Oleg Nesterov <oleg@redhat.com> wrote:

> insn_get_length() has the side-effect of processing the entire instruction
> but only if it was decoded successfully, otherwise insn_complete() can fail
> and in this case we need to just return an error without warning.
> 

This looks good to me.

Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> Reported-by: syzbot+30d675e3ca03c1c351e7@syzkaller.appspotmail.com
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---
>  arch/x86/kernel/uprobes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
> index 85c7ef2..efd7ee9 100644
> --- a/arch/x86/kernel/uprobes.c
> +++ b/arch/x86/kernel/uprobes.c
> @@ -293,7 +293,7 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool
>  	insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64);
>  	/* has the side-effect of processing the entire instruction */
>  	insn_get_length(insn);
> -	if (WARN_ON_ONCE(!insn_complete(insn)))
> +	if (!insn_complete(insn))
>  		return -ENOEXEC;
>  
>  	if (is_prefix_bad(insn))
> -- 
> 2.5.0
> 
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

      reply	other threads:[~2018-05-18 23:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 14:24 WARNING in arch_uprobe_analyze_insn syzbot
2018-05-15 13:36 ` Oleg Nesterov
2018-05-15 14:48   ` Masami Hiramatsu
2018-05-15 16:18     ` Oleg Nesterov
2018-05-18 16:27 ` [PATCH] uprobes/x86: remove the wrong WARN_ON() in uprobe_init_insn() Oleg Nesterov
2018-05-18 23:58   ` Masami Hiramatsu [this message]

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=20180519085848.e2b0be1ed752e3e35b7ba0ab@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=syzbot+30d675e3ca03c1c351e7@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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