Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2043879imm; Mon, 16 Jul 2018 00:46:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpevjSkfZ/YwIutj9HhKKm9CoXZPwQkW5KgFCbLPe2F2QIis1wI2DmMeMQG7Ub0up1lfFmiM X-Received: by 2002:aa7:8307:: with SMTP id t7-v6mr16988369pfm.81.1531727218158; Mon, 16 Jul 2018 00:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727218; cv=none; d=google.com; s=arc-20160816; b=uJnWWpYfQTW3ilfcyfcNhTsg2TKcpuAyCHhFW0NhAqOjwfDjlg2N71Kz0flYMtbHzO hfY3mOBOoS7VLkK/gza7qydbxYkoRHXzRkFLxhaNBJGF9Ee7h351doZwcBL57dlUirH/ DE03twgy0XJlC2He+ZEv5/MQj1auBk62Xjta9N9dEhA6vfk9hkj+KF641r6xA/1T1bz5 3ocd5Hyu1Xb2tV29CYFKxg34yyPu9qua77zfzCLGQeX0kfvBJ00yIb+VM5HflKC5QUZ9 +kzIkfnu3iHjToiF6+oGjT71DAyr02SKWTXQLEY5vtS6YqKy+GUMcONTbR0l9MA+9Qho Lpaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Zd5lUXW8bBFYYB9NaABfmYoGqwqwxHWX8XSXC4BI0Jw=; b=XlV+zUxb1VirTBXyAXR1b+h/5L4uscc0eL10p2zdYAIYV85D0zNPjmOiGNJe9N+M6I kDQ3jtaL/EuCKCpi6omyGTvhP9j+O9WUTrxHgvQBj+LQpu+EkGQUouN+wr2LL+TQsF6d zqfGdD4vJ+1Qy2fR7pI38K8S+HrIcrgX5wt79qIZpLwgm/S+cy6Yp5MKt8kTqx8GXIjh 4z8he8Fk4WShmqJLpb8p9T6aMDSMJkvKmXdrObAhkH75NCWvzjvSqndZlYiYIB8GYO14 UWMJ8o1Xi4AfAQ68UueKUeHe8TU6i9qyx7ySuzSmHK29ONeTgj0hGc7261VhKagMjkCj 0cjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9-v6si21108833pgc.685.2018.07.16.00.46.43; Mon, 16 Jul 2018 00:46:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389568AbeGPILW (ORCPT + 99 others); Mon, 16 Jul 2018 04:11:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48958 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388939AbeGPILV (ORCPT ); Mon, 16 Jul 2018 04:11:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0FB01CC2; Mon, 16 Jul 2018 07:45:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+30d675e3ca03c1c351e7@syzkaller.appspotmail.com, Oleg Nesterov , Masami Hiramatsu , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , syzkaller-bugs@googlegroups.com, Ingo Molnar Subject: [PATCH 4.4 37/43] uprobes/x86: Remove incorrect WARN_ON() in uprobe_init_insn() Date: Mon, 16 Jul 2018 09:36:42 +0200 Message-Id: <20180716073515.996604764@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Oleg Nesterov commit 90718e32e1dcc2479acfa208ccfc6442850b594c 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: syzbot+30d675e3ca03c1c351e7@syzkaller.appspotmail.com Signed-off-by: Oleg Nesterov Reviewed-by: Masami Hiramatsu Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: syzkaller-bugs@googlegroups.com Link: https://lkml.kernel.org/lkml/20180518162739.GA5559@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c @@ -290,7 +290,7 @@ static int uprobe_init_insn(struct arch_ 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))