Skip to content

Commit 21ed24f

Browse files
oleg-nesterovZhengShunQian
authored andcommitted
uprobes/x86: Remove incorrect WARN_ON() in uprobe_init_insn()
commit 90718e3 upstream. 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: [email protected] Signed-off-by: Oleg Nesterov <[email protected]> Reviewed-by: Masami Hiramatsu <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/lkml/[email protected] Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a738f9a commit 21ed24f

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
@@ -290,7 +290,7 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool
290290
insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64);
291291
/* has the side-effect of processing the entire instruction */
292292
insn_get_length(insn);
293-
if (WARN_ON_ONCE(!insn_complete(insn)))
293+
if (!insn_complete(insn))
294294
return -ENOEXEC;
295295

296296
if (is_prefix_bad(insn))

0 commit comments

Comments
 (0)