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 62D16AC0F81 for ; Wed, 18 Oct 2023 10:33:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=mKKayLd0OKhChbyWRc0skNBjjaWD2lVdRk5cv8Lsq7Q=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID: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=1697625231; v=1; b=ga5L8oydodkE4Btulaii7bIUEiPiQhIVtVA/nsD1sRiTQV0hGDviuoPRHnOk06vfTEHp2EHy GXkNn0VymBsaQBgdF0hTp5IIF62YwdHjLDxHP/KFVukIqdtnQh51cn6+St/9elT4dyyRaQBTrub JnMjZxEKLnM7LrjX8CYhCeGM= X-Received: by 127.0.0.2 with SMTP id BBwDYY7687511xAGkRpnl6Jq; Wed, 18 Oct 2023 03:33:51 -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.278125.1697625230483396917 for ; Wed, 18 Oct 2023 03:33:50 -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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-nZggM21DN-G-6AXs-4-xxQ-1; Wed, 18 Oct 2023 06:33:30 -0400 X-MC-Unique: nZggM21DN-G-6AXs-4-xxQ-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2CC1788B76E; Wed, 18 Oct 2023 10:33:30 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.243]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E65742026D4C; Wed, 18 Oct 2023 10:33:29 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 830C718000A6; Wed, 18 Oct 2023 12:33:28 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jordan Justen , Gerd Hoffmann , Ard Biesheuvel , =?UTF-8?q?L=C3=A1szl=C3=B3=20=C3=89rsek?= , Oliver Steffen , Jiewen Yao Subject: [edk2-devel] [PATCH 1/1] OvmfPkg/VirtioFsDxe: fix SimpleFileOpen Date: Wed, 18 Oct 2023 12:33:28 +0200 Message-ID: <20231018103328.91093-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: 9QlIXpLTSsyuOrEweULJlqqEx7686176AA= 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=ga5L8oyd; 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 VirtiofsDxe throws an error in case the caller tries to open a file or directory using an handle with is not a directory, claiming that opening something relative to a file does not make sense. The claim is correct, but the code throws errors for both relative and absolute paths. Add a check to fix that. Signed-off-by: Gerd Hoffmann --- OvmfPkg/VirtioFsDxe/SimpleFsOpen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c index a13d4f6a1e2d..1729ea2f5cf2 100644 --- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c +++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c @@ -397,7 +397,7 @@ VirtioFsSimpleFileOpen ( // it cannot be implemented consistently with how a file is referred to // relative to a directory). // - if (!VirtioFsFile->IsDirectory) { + if (!VirtioFsFile->IsDirectory && FileName[0] != '\\') { DEBUG (( DEBUG_ERROR, ("%a: Label=\"%s\" CanonicalPathname=\"%a\" FileName=\"%s\": " -- 2.41.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109727): https://edk2.groups.io/g/devel/message/109727 Mute This Topic: https://groups.io/mt/102036263/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-