From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: "Jordan Justen" <jordan.l.justen@intel.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Ard Biesheuvel" <ardb+tianocore@kernel.org>,
"László Érsek" <lersek@redhat.com>,
"Oliver Steffen" <osteffen@redhat.com>,
"Jiewen Yao" <jiewen.yao@intel.com>
Subject: [edk2-devel] [PATCH 1/1] OvmfPkg/VirtioFsDxe: fix SimpleFileOpen
Date: Wed, 18 Oct 2023 12:33:28 +0200 [thread overview]
Message-ID: <20231018103328.91093-1-kraxel@redhat.com> (raw)
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 <kraxel@redhat.com>
---
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]
-=-=-=-=-=-=-=-=-=-=-=-
next reply other threads:[~2023-10-18 10:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 10:33 Gerd Hoffmann [this message]
2023-10-18 11:20 ` [edk2-devel] [PATCH 1/1] OvmfPkg/VirtioFsDxe: fix SimpleFileOpen Laszlo Ersek
2023-10-18 11:33 ` Pedro Falcato
2023-10-18 12:20 ` Laszlo Ersek
2023-10-18 13:08 ` Pedro Falcato
2023-10-18 14:03 ` Laszlo Ersek
2023-10-18 13:13 ` Gerd Hoffmann
2023-10-18 15:13 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231018103328.91093-1-kraxel@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox