From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 245BB941507 for ; Fri, 19 Apr 2024 11:31:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cPJoycFej6C86qnd0PLgXoPkz4OZxAtUZr1hrVaBd5o=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition:Content-Transfer-Encoding; s=20240206; t=1713526292; v=1; b=Bw1Vlsi/K0pTrYzraDzF4OArTvUyHrs1HjOHGhDD/3eBA/k6uODv9T1+gUCl8N8ekg1RoFHw YdkwLkq/s65vGRmgfDV8L4+BeGkNz5acRTeou8404srKKRcs8T+gQ/R55RZQm1eY8W49kq7/V3X REpnDKOgqa3GJ7LFndS6vRgyWA2FT7iaRZnqMBN3Lb5Y3XDV3nGzASKXo5s2udW/tbzSd9MBEU7 crDHeYaz79w22taq7oFy+phJF7BH7r+ruqRbMtlh1TzXzd3/t6MBt9qfNdpsvXypXZkcXIAclog 6BqQ4F1CQr9H4YAlEA0voWHCyTa0p3idkT1BY9aC1t3yQ== X-Received: by 127.0.0.2 with SMTP id qWwAYY7687511xQhS0xmORFg; Fri, 19 Apr 2024 04:31:32 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.18291.1713526286907588562 for ; Fri, 19 Apr 2024 04:31:27 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-220-ngneJ1muO_iUeevy6skelw-1; Fri, 19 Apr 2024 07:31:22 -0400 X-MC-Unique: ngneJ1muO_iUeevy6skelw-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8E7D3811716; Fri, 19 Apr 2024 11:31:21 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B580A1C060D0; Fri, 19 Apr 2024 11:31:21 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B58A01800DFD; Fri, 19 Apr 2024 13:31:20 +0200 (CEST) Date: Fri, 19 Apr 2024 13:31:20 +0200 From: "Gerd Hoffmann" To: Adam Dunlap Cc: devel@edk2.groups.io, Borislav Petkov , Peter Gonda , Tom Lendacky Subject: Re: [edk2-devel] [PATCH] OvmfPkg: Harden #VC instruction emulation somewhat (CVE-2024-25742) Message-ID: References: <20240417165400.3615824-1-acdunlap@google.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 19 Apr 2024 04:31:27 -0700 Resent-From: kraxel@redhat.com Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YBmFuBTS7abChcpbJBK4L0kax7686176AA= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="Bw1Vlsi/"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On Thu, Apr 18, 2024 at 08:39:20AM -0700, Adam Dunlap wrote: > On Thu, Apr 18, 2024 at 5:15 AM Gerd Hoffmann wrote: > > > > On Wed, Apr 17, 2024 at 09:54:00AM -0700, Adam Dunlap via groups.io wrote: > > > + UINT8 OpCode; > > > > The linux kernel patch uses "unsigned int opcode" and apparently > > checks more than just the first byte for multi-byte opcodes. Why > > do it differently here? > > Good question. This patch does check for two-byte opcodes with this snippet: > > + OpCode = *(InstructionData->OpCodes); > + if (OpCode == TWO_BYTE_OPCODE_ESCAPE) { > + OpCode = *(InstructionData->OpCodes + 1); > + } > > This works because the first byte of two-byte opcodes is always 0x0f in the > cases that we're checking for. Ok, missed that little detail. Thanks for explaining. Reviewed-by: Gerd Hoffmann take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118018): https://edk2.groups.io/g/devel/message/118018 Mute This Topic: https://groups.io/mt/105581633/7686176 Mute #vc:https://edk2.groups.io/g/devel/mutehashtag/vc Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-