Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2040580imm; Mon, 16 Jul 2018 00:41:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpftI6175NHVm6YEWLrN2yESy9GjtxfYs7dMHzrwYnzqeli3HJAbB58FF8j/nx0xNIq5XoY1 X-Received: by 2002:a62:47c4:: with SMTP id p65-v6mr17253266pfi.170.1531726916349; Mon, 16 Jul 2018 00:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726916; cv=none; d=google.com; s=arc-20160816; b=cltifq91o3nhroupcsjXE5P/yvT4jGu53zzU0nCcUtFpT51IHH4IGR+EDyxnhRqIId SeUbQMPz+tdvv+bea9XCc/T9nJvu/AbepUd1VUjzz26wjktn1FnJMadxGbm34cHRMuXh osFVVbA6nVTTHM/Gi1YVl946esSbMGTOlSbtVoDZEmKgDRdwwFXEMS8XBjG5u9b1rb2Q uaT6w4nkylUSlnbmf1HWa6icZyjJsL+r0EnULsR3FHLCFbhqiw8Rg0ev9z1JVRcqwoa5 LJD/bzZ9uXUpAmeu6lJEjt9njeum+i2nKTu8FsD96VKXPw++gUal7hfgMEkiD66naFB3 gi5w== 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=VyBsyHNa/Fg+ck7AUhtnJb/ydvgRTPPIGax31YBeeSo=; b=WVG72rCP4yG1yTXV+zCoOJPmnlfexwTX0D4+3cSLUl4+ezazurlhBeoAue3o4QxJci O1rlzKnTLfWXl8RIJZNvwo9Cno1er2ZjBjfC5W/sr/8CdvHyqwHHUp2TjzT+QSO70aPW byopl2F/OF10ZOtQ2Y5a/B/jJSKd49cuchljxBG3gHwO/0xBWcP6tsxiMBfvB9/SqMk2 vzggJO18fSPXggPUInD9v3x5uU2VdBpdlOfa7fdBUn7uWqA2cIAXALLEuyAv3xUVcPPL hkzDe1p0ME12OEvB7UoV1zAY9S3Ra3yBeCUog2da7gi5e6VrTFvxKcuP3cwptZFkZLmw K1yA== 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 c7-v6si31247979pfg.308.2018.07.16.00.41.41; Mon, 16 Jul 2018 00:41:56 -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 S2387948AbeGPIF0 (ORCPT + 99 others); Mon, 16 Jul 2018 04:05:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47120 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeGPIFZ (ORCPT ); Mon, 16 Jul 2018 04:05:25 -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 255E3C03; Mon, 16 Jul 2018 07:39:23 +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.17 53/67] uprobes/x86: Remove incorrect WARN_ON() in uprobe_init_insn() Date: Mon, 16 Jul 2018 09:35:22 +0200 Message-Id: <20180716073451.886993174@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@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.17-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 @@ -293,7 +293,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))