audk/OvmfPkg/VirtioFsDxe
Laszlo Ersek e9c5ff3d27 OvmfPkg/VirtioFsDxe: call IsTimeValid() before EfiTimeToEpoch()
EmbeddedPkg/TimeBaseLib provides a verification function called
IsTimeValid(), for enforcing the UEFI spec requirements on an EFI_TIME
object.

When EFI_FILE_PROTOCOL.SetInfo() is called in order to update the
timestamps on the file, let's invoke IsTimeValid() first, before passing
the new EFI_FILE_INFO.{CreateTime,LastAccessTime,ModificationTime} values
to EfiTimeToEpoch().

This patch is not expected to make a practical difference, but it's better
to ascertain the preconditions of EfiTimeToEpoch() on the
EFI_FILE_PROTOCOL.SetInfo() caller. The FAT driver (EnhancedFatDxe) has a
similar check, namely in FatSetFileInfo() -> FatIsValidTime().

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20210107095051.22715-1-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2021-01-07 14:13:44 +00:00
..
DriverBinding.c OvmfPkg/VirtioFsDxe: implement EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.OpenVolume() 2020-12-21 17:16:23 +00:00
FuseFlush.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_FLUSH 2020-12-21 17:16:23 +00:00
FuseForget.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_FORGET 2020-12-21 17:16:23 +00:00
FuseFsync.c OvmfPkg/VirtioFsDxe: add a shared wrapper for FUSE_FSYNC / FUSE_FSYNCDIR 2020-12-21 17:16:23 +00:00
FuseGetAttr.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_GETATTR 2020-12-21 17:16:23 +00:00
FuseInit.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_WRITE 2020-12-21 17:16:23 +00:00
FuseLookup.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_LOOKUP 2020-12-21 17:16:23 +00:00
FuseMkDir.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_MKDIR 2020-12-21 17:16:23 +00:00
FuseOpen.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_OPEN 2020-12-21 17:16:23 +00:00
FuseOpenDir.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_OPENDIR 2020-12-21 17:16:23 +00:00
FuseOpenOrCreate.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_CREATE 2020-12-21 17:16:23 +00:00
FuseRead.c OvmfPkg/VirtioFsDxe: add a shared wrapper for FUSE_READ / FUSE_READDIRPLUS 2020-12-21 17:16:23 +00:00
FuseRelease.c OvmfPkg/VirtioFsDxe: add shared wrapper for FUSE_RELEASE / FUSE_RELEASEDIR 2020-12-21 17:16:23 +00:00
FuseRename.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_RENAME2 2020-12-21 17:16:23 +00:00
FuseSetAttr.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_SETATTR 2020-12-21 17:16:23 +00:00
FuseStatFs.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_STATFS 2020-12-21 17:16:23 +00:00
FuseUnlink.c OvmfPkg/VirtioFsDxe: add a shared wrapper for FUSE_UNLINK / FUSE_RMDIR 2020-12-21 17:16:23 +00:00
FuseWrite.c OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_WRITE 2020-12-21 17:16:23 +00:00
Helpers.c OvmfPkg/VirtioFsDxe: call IsTimeValid() before EfiTimeToEpoch() 2021-01-07 14:13:44 +00:00
SimpleFsClose.c OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE 2020-12-21 17:16:23 +00:00
SimpleFsDelete.c OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE 2020-12-21 17:16:23 +00:00
SimpleFsFlush.c OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.Flush() 2020-12-21 17:16:23 +00:00
SimpleFsGetInfo.c OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.GetInfo() 2020-12-21 17:16:23 +00:00
SimpleFsGetPosition.c OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.GetPosition, .SetPosition 2020-12-21 17:16:23 +00:00
SimpleFsOpen.c OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE 2020-12-21 17:16:23 +00:00
SimpleFsOpenVolume.c OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE 2020-12-21 17:16:23 +00:00
SimpleFsRead.c OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.Read() for directories 2020-12-21 17:16:23 +00:00
SimpleFsSetInfo.c OvmfPkg/VirtioFsDxe: handle attribute updates in EFI_FILE_PROTOCOL.SetInfo 2020-12-21 17:16:23 +00:00
SimpleFsSetPosition.c OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE 2020-12-21 17:16:23 +00:00
SimpleFsWrite.c OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.Write() 2020-12-21 17:16:23 +00:00
VirtioFsDxe.h OvmfPkg/VirtioFsDxe: add helper for determining file mode bits update 2020-12-21 17:16:23 +00:00
VirtioFsDxe.inf OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_SETATTR 2020-12-21 17:16:23 +00:00