Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042352imm; Mon, 16 Jul 2018 00:44:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffj6GT+yS/qH6l9syuus+Fo8BqdRbMBI2WsE9asbEld1MT/QH7eLmX7PaPUGvvB//sjAI6 X-Received: by 2002:a17:902:be0d:: with SMTP id r13-v6mr15547613pls.299.1531727080019; Mon, 16 Jul 2018 00:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727079; cv=none; d=google.com; s=arc-20160816; b=YYbly3w71Cc57hbVdWj7JWCtBKhf2giGn0f2qoMnLmFnmiTSZXXe3j5Ux45mhYENpA lU4BXuKZpDh2JTtbXWwpscaVID9qfQZIWcq1SHn/Ddq8mZ8P/ffqiw3qBDJYLaR8yy9j HjllYZJIdWAAYDacgbHKGQSaKUs3KFUX+vLiL+6mI5u3IaEetpdAIof1tOGsyiLdpn07 18DLAOPhktzSsSHK/glh/QHqQgV4Ua0phaX146mmmtVh06AyEhZEWn9pWlUVoppiOAXY 4JbS7A6eJqYvPFEeY+YSwH4Lz1RWpaYJcB2XE6fC4a6nPTQQ10j/ip4QnkOSxB2Yfc3F vCrA== 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=VqcDmrj8xR0Up8TwSqjvFG/oeVusJdC3PBKrwUumlFY=; b=s5d0ugVRsUbEaMPyeNWxWSB6X6JESwC+sTuKQge7F7xShv8IzXXqMfcTJF5ZVyYJ1U gtzp9XY+biorHGhWPZCUNPNBCO0F/2Y/E6r6JXEE2okNcS3P89FOaatL7Cv15zoFnBSh 70/dLTD0mtaK760ueI9EAa7Zh1ZWtBDI90xtKIL2LufoCe8umYZHGlk7FNJtPTTR/lKq HpxxvkJjwY54WdwHj51ZEbyKpcMte0BXU8SpzVNpJSoeFgppfLqHs2Lb053pICF5OFZ7 DysJf74TUuEA+9m0GBKz/wL2FQShniG+nB/t/ydCC2zP31vtem4Bm5fhLPcYq33Sl3Ro pEmw== 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 r10-v6si27976109pgm.535.2018.07.16.00.44.25; Mon, 16 Jul 2018 00:44:39 -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 S2388964AbeGPIJP (ORCPT + 99 others); Mon, 16 Jul 2018 04:09:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47944 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbeGPIJO (ORCPT ); Mon, 16 Jul 2018 04:09:14 -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 BBB76C03; Mon, 16 Jul 2018 07:43:10 +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.9 26/32] uprobes/x86: Remove incorrect WARN_ON() in uprobe_init_insn() Date: Mon, 16 Jul 2018 09:36:34 +0200 Message-Id: <20180716073507.766198974@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@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.9-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))