From nobody Sat May 4 01:01:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linuxfoundation.org ARC-Seal: i=1; a=rsa-sha256; t=1652364171; cv=none; d=zohomail.com; s=zohoarc; b=BDjAkDSuY9hrGjkh8jzMxTeKzJykMPEn5XfLgJxOMRoBXnBuk4mqxHJsLJhc3XEBbybrWnQRqqIX1bW7ZrwCd+ceDpKbAEtN3hqByEbCv/wfLx2myacKqxQ6LatVwJ9z+SOwfDc5T6k7E+hvl37hInjfYtqsddWsw0Dz553D4CU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652364171; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=4hEO9XOcG3doLIpT3ff3nMlIucBnY4hjQuBdG60klz4=; b=Kyt4de6VZzY/sgybQPkfycGCRcWrSJiFhoioS7lQyTsbxjzMBnzsuwjl9wxAf1rLiVOfeZfzG0190HOffnSV9m7CveHsmtopALunVlIILe3JD1zdNVHt5uyjXXEEVAHKs1XiRIR2DSW85Bxj8YGj8tNPELP7qgBtlgUrnGTqcRA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1652364171724770.62520647306; Thu, 12 May 2022 07:02:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.327728.550622 (Exim 4.92) (envelope-from ) id 1np9OG-00028q-61; Thu, 12 May 2022 14:02:04 +0000 Received: by outflank-mailman (output) from mailman id 327728.550622; Thu, 12 May 2022 14:02:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1np9OG-000288-1d; Thu, 12 May 2022 14:02:04 +0000 Received: by outflank-mailman (input) for mailman id 327728; Thu, 12 May 2022 14:02:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1np9OF-0001rh-7R for xen-devel@lists.xenproject.org; Thu, 12 May 2022 14:02:03 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 11e0eeca-d1fc-11ec-8fc4-03012f2f19d4; Thu, 12 May 2022 16:01:50 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C5CF4B8283A; Thu, 12 May 2022 14:02:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A014C34114; Thu, 12 May 2022 14:01:59 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 11e0eeca-d1fc-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652364119; bh=r9ta6P7ZRths+9S/6LdjeCw30mXxnb+dFJ5Xg+4yH1s=; h=Subject:To:Cc:From:Date:From; b=mCd+vYC3ZkawcmV7o+Y+NM5UgkuRmcMu2m3QTfB9N70iVs8JumaNameETgECwhPVm Z8f5BU6iLUAar9tWAO44LfGDGqg7M+ezYG7aaTA3VTYOVuto3hv1RXWi7fGguUUpDK ONv4RQUITdd4TULXAP2O3c7LXGS//QfF/TTAnyI4= Subject: Patch "x86: kprobes: Prohibit probing on instruction which has emulate prefix" has been added to the 5.4-stable tree To: andrew.cooper3@citrix.com,boris.ostrovsky@oracle.com,bp@alien8.de,gregkh@linuxfoundation.org,jgross@suse.com,jpoimboe@redhat.com,mheyne@amazon.de,mhiramat@kernel.org,mingo@kernel.org,peterz@infradead.org,rdunlap@infradead.org,sstabellini@kernel.org,x86@kernel.org,xen-devel@lists.xenproject.org Cc: From: Date: Thu, 12 May 2022 16:01:38 +0200 Message-ID: <165236409813853@kroah.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-stable: commit X-Patchwork-Hint: ignore X-ZohoMail-DKIM: pass (identity @linuxfoundation.org) X-ZM-MESSAGEID: 1652364173540100001 Content-Type: text/plain; charset="utf-8" This is a note to let you know that I've just added the patch titled x86: kprobes: Prohibit probing on instruction which has emulate prefix to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.git= ;a=3Dsummary The filename of the patch is: x86-kprobes-prohibit-probing-on-instruction-which-has-emulate-prefix.p= atch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From 004e8dce9c5595697951f7cd0e9f66b35c92265e Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Fri, 6 Sep 2019 22:14:20 +0900 Subject: x86: kprobes: Prohibit probing on instruction which has emulate pr= efix From: Masami Hiramatsu commit 004e8dce9c5595697951f7cd0e9f66b35c92265e upstream. 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 Signed-off-by: Maximilian Heyne Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/kprobes/core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -358,6 +358,10 @@ int __copy_instruction(u8 *dest, u8 *src 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; Patches currently in stable-queue which might be from mhiramat@kernel.org a= re queue-5.4/x86-xen-kvm-gather-the-definition-of-emulate-prefixes.patch queue-5.4/x86-xen-insn-decode-xen-and-kvm-emulate-prefix-signature.patch queue-5.4/x86-asm-allow-to-pass-macros-to-__asm_form.patch queue-5.4/x86-kprobes-prohibit-probing-on-instruction-which-has-emulate-pre= fix.patch