Received: by 10.213.65.68 with SMTP id h4csp1786714imn; Mon, 19 Mar 2018 13:14:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELt5etyjn1Q8zViD2KeCKxAUSzRgryfZzUq3PDRh8ogj0eEyTZq0cJBOxAD9kN/waMSDvsLc X-Received: by 10.99.188.9 with SMTP id q9mr7207625pge.381.1521490470679; Mon, 19 Mar 2018 13:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521490470; cv=none; d=google.com; s=arc-20160816; b=mgFlzO8eGX7N7u7PCxwhnzJyqImL4MjfHFEfzvfWpR2P2bhFz77HvSl6fqUNZZIrbb tVR0spWAbf+M5GfBxHzK5IY3Xz63tslG3lSJM8hXnXyVu3VguuSex+ofkXYFSc+a2uQ/ 1D48xFTouqgzP0hyaGGPKeyvDQBy7qQORKXPdkZnHYHW0fUxdggw1T8krsKnzB1DhYys 4oM/KS2KT5PXLON4dTjqaiCRIiDvnE9JLsFL+dPaVRxEfRWx4ihQZfUxCoHEanf6auUe hIc2Kw4n0J2+yBqvKWyvYX2WaxAjBy1zHGO4jDod8B03VfJ19saAtTtzl5VLpllMPNLs +T+g== 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=LFFX240I0lPoSXrqH8MCVMsVMn0HZUAi0CD1H4kE8+E=; b=ATuRWZ7CD0QfDp+7s4qOhpTqebpF0VkLamHvllnS5D3Meufl1Z7ZM4NSAd9Zy1Msf8 mhDqXcTf8oW+aXZwbbPM+PoL7yT7B6LmNdhZZujeqCAPqQmdqlAsXr8CU3WJIGb7mFqc IhHU7ZjpqDNOHQUIYdT3PaomH+9PCk4Ke34DnpSAEC6I5gwT+a3lBDelrx/ya5VlI9Ov TNeU89GNlsjMzn6sDrTPPFQDbfrIKVN3/pltfenkZS37cUE/yFn7kx6gdw1h8c4BpC/8 qNAuM4ajsd0TtYDrj61yKCypMZW77qBlQPTQZdEUXSfJumyQH4JFu96DGzBk4MnkAncK qYPQ== 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 b34-v6si15446pld.249.2018.03.19.13.14.16; Mon, 19 Mar 2018 13:14:30 -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 S971130AbeCSUMw (ORCPT + 99 others); Mon, 19 Mar 2018 16:12:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45210 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030828AbeCSSQj (ORCPT ); Mon, 19 Mar 2018 14:16:39 -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 2528A11DD; Mon, 19 Mar 2018 18:16:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Ananth N Mavinakayanahalli , Andrey Ryabinin , Anil S Keshavamurthy , Borislav Petkov , Brian Gerst , "David S . Miller" , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ye Xiaolong , Ingo Molnar , Sasha Levin Subject: [PATCH 4.4 075/134] kprobes/x86: Fix kprobe-booster not to boost far call instructions Date: Mon, 19 Mar 2018 19:05:58 +0100 Message-Id: <20180319171900.096699499@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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: Masami Hiramatsu [ Upstream commit bd0b90676c30fe640e7ead919b3e38846ac88ab7 ] Fix the kprobe-booster not to boost far call instruction, because a call may store the address in the single-step execution buffer to the stack, which should be modified after single stepping. Currently, this instruction will be filtered as not boostable in resume_execution(), so this is not a critical issue. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Andrey Ryabinin Cc: Anil S Keshavamurthy Cc: Borislav Petkov Cc: Brian Gerst Cc: David S . Miller Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ye Xiaolong Link: http://lkml.kernel.org/r/149076340615.22469.14066273186134229909.stgit@devbox Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/kprobes/core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -196,6 +196,8 @@ retry: return (opcode != 0x62 && opcode != 0x67); case 0x70: return 0; /* can't boost conditional jump */ + case 0x90: + return opcode != 0x9a; /* can't boost call far */ case 0xc0: /* can't boost software-interruptions */ return (0xc1 < opcode && opcode < 0xcc) || opcode == 0xcf;