Skip to content

Commit 90718e3

Browse files
oleg-nesterovIngo Molnar
authored andcommitted
uprobes/x86: Remove incorrect WARN_ON() in uprobe_init_insn()
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. Reported-by: syzbot+30d675e3ca03c1c351e7@syzkaller.appspotmail.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: syzkaller-bugs@googlegroups.com Link: https://lkml.kernel.org/lkml/20180518162739.GA5559@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent a89d0c2 commit 90718e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/uprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool
293293
insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64);
294294
/* has the side-effect of processing the entire instruction */
295295
insn_get_length(insn);
296-
if (WARN_ON_ONCE(!insn_complete(insn)))
296+
if (!insn_complete(insn))
297297
return -ENOEXEC;
298298

299299
if (is_prefix_bad(insn))

0 commit comments

Comments
 (0)