summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2020-12-16 22:10:53 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-12-21 17:16:23 +0000
commit9307d7c7a4a851615f1c4ac92e59f1ba33a3f626 (patch)
treec957e87adb2b4ab5f8f2ab1e2f3cb624594b8303 /OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
parent28092a3938655be5805dd042a5313ec2b948294a (diff)
downloadedk2-9307d7c7a4a851615f1c4ac92e59f1ba33a3f626.tar.gz
edk2-9307d7c7a4a851615f1c4ac92e59f1ba33a3f626.tar.bz2
edk2-9307d7c7a4a851615f1c4ac92e59f1ba33a3f626.zip
OvmfPkg/VirtioFsDxe: add helper for appending and sanitizing paths
EFI_FILE_PROTOCOL.Open() -- for opening files -- and EFI_FILE_PROTOCOL.SetInfo() -- for renaming files -- will require us to append a relative UEFI pathname to an absolute base pathname. In turn, components of the resultant pathnames will have to be sent to virtiofsd, which does not consume UEFI-style pathnames. We're going to maintain the base pathnames in canonical POSIX format: - absolute (starts with "/"), - dot (.) and dot-dot (..) components resolved/removed, - uses forward slashes, - sequences of slashes collapsed, - printable ASCII character set, - CHAR8 encoding, - no trailing slash except for the root directory itself, - length at most VIRTIO_FS_MAX_PATHNAME_LENGTH. Add a helper function that can append a UEFI pathname to such a base pathname, and produce the result in conformance with the same invariants. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3097 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20201216211125.19496-17-lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf')
-rw-r--r--OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf1
1 files changed, 1 insertions, 0 deletions
diff --git a/OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf b/OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
index 15e21772c8..0c92bccdac 100644
--- a/OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
+++ b/OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
@@ -104,6 +104,7 @@
[LibraryClasses]
BaseLib
+ BaseMemoryLib
DebugLib
MemoryAllocationLib
UefiBootServicesTableLib