From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 1D285AC16A0 for ; Tue, 16 Jan 2024 17:11:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=0OiWpnORxqO6SD9ZpwJrK6sOc+yPH05Api2h/SV6Gt0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1705425075; v=1; b=K3qR6C/1F7crec2VSxIsprdf/waQ1JQ/mdxjitNpX5X6sRk4iReR5C+40dyFwItxbT30l0UV fkh3KP71FbEKeo8sxnXxxEoLDr9AAjXFZ7PX6cBgOPQ9lcle3NRzihnw7Fi6NeC21YiklINFCeT ax3BwujiLsvCLaEzkUmctVLY= X-Received: by 127.0.0.2 with SMTP id bsu3YY7687511xOBXwSk9Z5S; Tue, 16 Jan 2024 09:11:15 -0800 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.22114.1705425073746295000 for ; Tue, 16 Jan 2024 09:11:13 -0800 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-221-Y5EptwN6N5y2dEagSAym3Q-1; Tue, 16 Jan 2024 12:11:11 -0500 X-MC-Unique: Y5EptwN6N5y2dEagSAym3Q-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 9B05385A58F for ; Tue, 16 Jan 2024 17:11:10 +0000 (UTC) X-Received: from dobby.home.kraxel.org (unknown [10.39.192.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A3CD2026D6F; Tue, 16 Jan 2024 17:11:10 +0000 (UTC) X-Received: by dobby.home.kraxel.org (Postfix, from userid 1000) id 66CB5AEDC2; Tue, 16 Jan 2024 18:11:05 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: oliver@redhat.com, Gerd Hoffmann , Laszlo Ersek Subject: [edk2-devel] [PATCH v3 5/6] OvmfPkg/VirtNorFlashDxe: ValidateFvHeader: unwritten state is EOL too Date: Tue, 16 Jan 2024 18:11:04 +0100 Message-ID: <20240116171105.37831-6-kraxel@redhat.com> In-Reply-To: <20240116171105.37831-1-kraxel@redhat.com> References: <20240116171105.37831-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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 Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1X7SmXHUhMOBA5RaAtQjfomKx7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="K3qR6C/1"; 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io It is possible to find variable entries with State being 0xff, i.e. not updated since flash block erase. This indicates the variable driver could not complete the header write while appending a new entry, and therefore State was not set to VAR_HEADER_VALID_ONLY. This can only happen at the end of the variable list, so treat this as additional "end of variable list" condition. Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek --- OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c index 8fcd999ac6df..c8b5e0be1379 100644 --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c @@ -302,6 +302,11 @@ ValidateFvHeader ( break; } + if (VarHeader->State == 0xff) { + DEBUG ((DEBUG_INFO, "%a: end of var list (unwritten state)\n", __func__)); + break; + } + VarName = NULL; switch (VarHeader->State) { // usage: State = VAR_HEADER_VALID_ONLY -- 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113920): https://edk2.groups.io/g/devel/message/113920 Mute This Topic: https://groups.io/mt/103766778/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-