[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 01/36] block/vvfat: Fix crash when reporting error ab
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 01/36] block/vvfat: Fix crash when reporting error about too many files in directory |
Date: |
Mon, 5 Nov 2018 17:37:09 +0100 |
From: Thomas Huth <address@hidden>
When using the vvfat driver with a directory that contains too many files,
QEMU currently crashes. This can be triggered like this for example:
mkdir /tmp/vvfattest
cd /tmp/vvfattest
for ((x=0;x<=513;x++)); do mkdir $x; done
qemu-system-x86_64 -drive \
file.driver=vvfat,file.dir=.,read-only=on,media=cdrom
Seems like read_directory() is changing the mapping->path variable. Make
sure we use the right pointer instead.
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vvfat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index fc41841a5c..f2e7d501cf 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -973,10 +973,10 @@ static int init_directories(BDRVVVFATState* s,
mapping = array_get(&(s->mapping), i);
if (mapping->mode & MODE_DIRECTORY) {
+ char *path = mapping->path;
mapping->begin = cluster;
if(read_directory(s, i)) {
- error_setg(errp, "Could not read directory %s",
- mapping->path);
+ error_setg(errp, "Could not read directory %s", path);
return -1;
}
mapping = array_get(&(s->mapping), i);
--
2.19.1
- [Qemu-block] [PULL 00/36] Block layer patches, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 02/36] block: replace "discard" literal with BDRV_OPT_DISCARD macro, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 03/36] qemu-io-cmds: Fix two format strings, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 01/36] block/vvfat: Fix crash when reporting error about too many files in directory,
Kevin Wolf <=
- [Qemu-block] [PULL 05/36] block/qcow: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 07/36] crypto: initialize sector size even when opening with no IO flag, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 06/36] block/qcow2-bitmap: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 04/36] block/qcow2: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 08/36] qcow2: Get the request alignment for encrypted images from QCryptoBlock, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 09/36] block: change some function return type to bool, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 12/36] block/vhdx: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 10/36] iotests: make 083 specific to raw, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 22/36] block: Require auto-read-only for existing fallbacks, Kevin Wolf, 2018/11/05
- [Qemu-block] [PULL 30/36] option: Make option help nicer to read, Kevin Wolf, 2018/11/05