gentoo/app-emulation/qemu/files/qemu-2.7.0-CVE-2016-9102.patch

22 lines
739 B
Diff
Raw Normal View History

2016-11-19 12:19:15 +01:00
From: Li Qiang <address@hidden>
The 'fs.xattr.value' field in V9fsFidState object doesn't consider the
situation that this field has been allocated previously. Every time, it
will be allocated directly. This leads a host memory leak issue. This
patch fix this.
--
1.8.3.1
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 75ba5f1..a4c7109 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3269,6 +3269,7 @@ static void v9fs_xattrcreate(void *opaque)
xattr_fidp->fs.xattr.flags = flags;
v9fs_string_init(&xattr_fidp->fs.xattr.name);
v9fs_string_copy(&xattr_fidp->fs.xattr.name, &name);
+ g_free(xattr_fidp->fs.xattr.value);
xattr_fidp->fs.xattr.value = g_malloc(size);
err = offset;
put_fid(pdu, file_fidp);