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 3D443D811C5 for ; Thu, 18 Apr 2024 12:15:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=M8m1BB2g5E65dGg6LMCpUlroNMZIodDp8CW+isGX798=; 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; s=20240206; t=1713442531; v=1; b=GFgiKGqiU/j5hFSGDvKGNbN7mfmE0yvac5eh78noxMscw/J2TDfDi9DdOY5x8ee//f0wiVeu nhDDMXFZZe19lABRZaVcYCBseW/OGWoZuewVhmuxNw00+eGwGQmUg9D8T62a5YMPNVEmN0CJU9u 3X7Nil3GT5KqdeZUrVC5/grut/OMoCOBzlDcHY8JrxQU2Vnp7YsZHN75fZefTgqwQTdWiCVk7gT rzziI3Eb8jnAfFsdYwF4GYAh0E4OUXPw1vmGv2qfHbHkBT3syuXo02Tpz8fEFHu3gpvDJP7Bkvy HIupDVAwUka1cJTgKxOZxVippH/JfvoZpJLzbzqzzp5dQ== X-Received: by 127.0.0.2 with SMTP id 8bQfYY7687511x1CnS1b5qpM; Thu, 18 Apr 2024 05:15:31 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.11180.1713442531022361960 for ; Thu, 18 Apr 2024 05:15:31 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-Zc6h1MKTMoixZ-KyfS2Tzw-1; Thu, 18 Apr 2024 08:15:26 -0400 X-MC-Unique: Zc6h1MKTMoixZ-KyfS2Tzw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 1932B18065B3; Thu, 18 Apr 2024 12:15:26 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E399E2166B34; Thu, 18 Apr 2024 12:15:25 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 924A01800DF8; Thu, 18 Apr 2024 14:15:24 +0200 (CEST) Date: Thu, 18 Apr 2024 14:15:24 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, acdunlap@google.com Cc: 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: <20240417165400.3615824-1-acdunlap@google.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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: Thu, 18 Apr 2024 05:15:31 -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: ZLLi38moswsxz1IlPPm3Ekl4x7686176AA= Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=GFgiKGqi; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On Wed, Apr 17, 2024 at 09:54:00AM -0700, Adam Dunlap via groups.io wrote: > Ensure that when a #VC exception happens, the instruction at the > instruction pointer matches the instruction that is expected given the > error code. This is to mitigate the ahoi WeSee attack [1] that could > allow hypervisors to breach integrity and confidentiality of the > firmware by maliciously injecting interrupts. This change is a > translated version of a linux patch e3ef461af35a ("x86/sev: Harden #VC > instruction emulation somewhat") > +**/ > +STATIC > +UINT64 > +VcCheckOpcodeBytes ( > + IN OUT GHCB *Ghcb, > + IN OUT EFI_SYSTEM_CONTEXT_X64 *Regs, > + IN OUT CC_INSTRUCTION_DATA *InstructionData, > + IN UINT64 ExitCode > + ) > +{ > + 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? On the bigger picture: I'm wondering why SNP allows external #VC injections in the first place? take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117985): https://edk2.groups.io/g/devel/message/117985 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] -=-=-=-=-=-=-=-=-=-=-=-