From nobody Mon Apr 29 09:14:01 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1571404051; cv=none; d=zoho.com; s=zohoarc; b=Guw63KIAD5OoAJtJqOoUZL6CL34in37v1sLRxAGvts+5xhIuD0l0C+vtIj+biDXEiTvTAJdMK0dpfzpt6nUkjlQomIdyjjFrsr4TnDDvsM6YyhiegnQI35CF/UFJIoL67l1V4wZdvg0Q2aUz1CIc/4PzjmTCmFAREl4cxdqGx3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571404051; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=f6/FN1UbZcumgHyvbM9XNI4XuR7hXgdsPLl4D4YnNgg=; b=JWmccbPAOriJz7YCfmc6t6NSiARPQMcpYtlCbIJvC3Y3HqCWRAtvP6yEZh6lvJ5KkiNFSZ+ZrszIosfNFbLcDUnYVXcmEX9ezdl+9ax7AlpdqZGIMXEp307RKRaO/DnPn4lefZco3EGWwAGn3sWYvyV3El/jVvCbKL9iJb4TdoU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1571404051947338.89891905272907; Fri, 18 Oct 2019 06:07:31 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iLRw4-0000rl-T9; Fri, 18 Oct 2019 13:04:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iLRgK-0007mx-OM for xen-devel@lists.xenproject.org; Fri, 18 Oct 2019 12:48:36 +0000 Received: from Galois.linutronix.de (unknown [2a0a:51c0:0:12e:550::1]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 974e38f0-f1a5-11e9-bbab-bc764e2007e4; Fri, 18 Oct 2019 12:48:32 +0000 (UTC) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iLRg2-00078J-T1; Fri, 18 Oct 2019 14:48:18 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 5E5E11C009C; Fri, 18 Oct 2019 14:48:18 +0200 (CEST) X-Inumbo-ID: 974e38f0-f1a5-11e9-bbab-bc764e2007e4 Date: Fri, 18 Oct 2019 12:48:18 -0000 From: "tip-bot2 for Masami Hiramatsu" To: linux-tip-commits@vger.kernel.org In-Reply-To: <156777566048.25081.6296162369492175325.stgit@devnote2> References: <156777566048.25081.6296162369492175325.stgit@devnote2> MIME-Version: 1.0 Message-ID: <157140289814.29376.7139596484011081680.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 X-Mailman-Approved-At: Fri, 18 Oct 2019 13:04:51 +0000 Subject: [Xen-devel] [tip: x86/core] x86: kprobes: Prohibit probing on instruction which has emulate prefix X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: linux-kernel@vger.kernel.org Cc: Juergen Gross , Stefano Stabellini , "Peter Zijlstra \(Intel\)" , Andrew Cooper , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Masami Hiramatsu , Josh Poimboeuf , xen-devel@lists.xenproject.org, Boris Ostrovsky , Randy Dunlap , Ingo Molnar Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The following commit has been merged into the x86/core branch of tip: Commit-ID: 004e8dce9c5595697951f7cd0e9f66b35c92265e Gitweb: https://git.kernel.org/tip/004e8dce9c5595697951f7cd0e9f66b35= c92265e Author: Masami Hiramatsu AuthorDate: Fri, 06 Sep 2019 22:14:20 +09:00 Committer: Peter Zijlstra CommitterDate: Thu, 17 Oct 2019 21:31:57 +02:00 x86: kprobes: Prohibit probing on instruction which has emulate prefix Prohibit probing on instruction which has XEN_EMULATE_PREFIX or KVM's emulate prefix. Since that prefix is a marker for Xen and KVM, if we modify the marker by kprobe's int3, that doesn't work as expected. Signed-off-by: Masami Hiramatsu Signed-off-by: Peter Zijlstra (Intel) Cc: Juergen Gross Cc: x86@kernel.org Cc: Boris Ostrovsky Cc: Ingo Molnar Cc: Stefano Stabellini Cc: Andrew Cooper Cc: Borislav Petkov Cc: xen-devel@lists.xenproject.org Cc: Randy Dunlap Cc: Josh Poimboeuf Link: https://lkml.kernel.org/r/156777566048.25081.6296162369492175325.stgi= t@devnote2 --- arch/x86/kernel/kprobes/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 43fc13c..4f13af7 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -351,6 +351,10 @@ int __copy_instruction(u8 *dest, u8 *src, u8 *real, st= ruct insn *insn) kernel_insn_init(insn, dest, MAX_INSN_SIZE); insn_get_length(insn); =20 + /* We can not probe force emulate prefixed instruction */ + if (insn_has_emulate_prefix(insn)) + return 0; + /* Another subsystem puts a breakpoint, failed to recover */ if (insn->opcode.bytes[0] =3D=3D BREAKPOINT_INSTRUCTION) return 0; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel