[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/23] vvfat: Fix volume name assertion
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v2 10/23] vvfat: Fix volume name assertion |
Date: |
Mon, 9 May 2016 13:07:54 +0100 |
From: Kevin Wolf <address@hidden>
Commit d5941dd made the volume name configurable, but it didn't consider
that the rw code compares the volume name string to assert that the
first directory entry is the volume name. This made vvfat crash in rw
mode.
This fixes the assertion to compare with the configured volume name
instead of a literal string.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/vvfat.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index 6b85314..ff3df35 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2283,12 +2283,17 @@ DLOG(fprintf(stderr, "commit_direntries for %s,
parent_mapping_index %d\n", mapp
factor * (old_cluster_count - new_cluster_count));
for (c = first_cluster; !fat_eof(s, c); c = modified_fat_get(s, c)) {
+ direntry_t *first_direntry;
void* direntry = array_get(&(s->directory), current_dir_index);
int ret = vvfat_read(s->bs, cluster2sector(s, c), direntry,
s->sectors_per_cluster);
if (ret)
return ret;
- assert(!strncmp(s->directory.pointer, "QEMU", 4));
+
+ /* The first directory entry on the filesystem is the volume name */
+ first_direntry = (direntry_t*) s->directory.pointer;
+ assert(!memcmp(first_direntry->name, s->volume_label, 11));
+
current_dir_index += factor;
}
--
2.5.5
- [Qemu-devel] [PATCH v2 00/23] libqos: use standard virtio headers, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 01/23] hw/ppc/spapr: Fix crash when specifying bad parameters to spapr-pci-host-bridge, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 02/23] usb/uhci: move pid check, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 03/23] spapr_drc: fix aborts during DRC-count based hotplug, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 04/23] QemuOpts: Fix qemu_opts_foreach() dangling location regression, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 10/23] vvfat: Fix volume name assertion,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 07/23] target-mips: Fix RDHWR exception host PC, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 11/23] vvfat: Fix default volume label, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 12/23] acpi: fix bios linker loadder COMMAND_ALLOCATE on bigendian host, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 09/23] qapi: Don't pass NULL to printf in string input visitor, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 13/23] configure: Check if struct fsxattr is available from linux header, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 15/23] Update version for v2.6.0-rc4 release, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 14/23] Revert "acpi: mark PMTIMER as unlocked", Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 18/23] libqos: drop duplicated virtio_config.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 17/23] libqos: drop duplicated PCI vendor ID definition, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 19/23] libqos: drop duplicated virtio_ring.h bit definitions, Stefan Hajnoczi, 2016/05/09