From eb23f6e92909a01306ff4e521fd959f26b9f9ef3 Mon Sep 17 00:00:00 2001 From: Ying Fang Date: Mon, 13 Jan 2020 11:32:53 +0800 Subject: [PATCH] There is a possible memory leak while local_link return -1 without free odirpath and oname. Signed-off-by: Ying Fang --- ...x-possible-memory-leak-in-local_link.patch | 21 +++++++++++++++++++ qemu.spec | 6 +++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 9pfs-local-Fix-possible-memory-leak-in-local_link.patch diff --git a/9pfs-local-Fix-possible-memory-leak-in-local_link.patch b/9pfs-local-Fix-possible-memory-leak-in-local_link.patch new file mode 100644 index 00000000..f9491f18 --- /dev/null +++ b/9pfs-local-Fix-possible-memory-leak-in-local_link.patch @@ -0,0 +1,21 @@ +There is a possible memory leak while local_link return -1 without free +odirpath and oname. + +Reported-by: Euler Robot +Reviewed-by: Christian Schoenebeck +Signed-off-by: Jaijun Chen +Signed-off-by: Xiang Zheng + +diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c +index 4708c0bd89..491b08aee8 100644 +--- a/hw/9pfs/9p-local.c ++++ b/hw/9pfs/9p-local.c +@@ -947,7 +947,7 @@ static int local_link(FsContext *ctx, V9fsPath *oldpath, + if (ctx->export_flags & V9FS_SM_MAPPED_FILE && + local_is_mapped_file_metadata(ctx, name)) { + errno = EINVAL; +- return -1; ++ goto out; + } + + odirfd = local_opendir_nofollow(ctx, odirpath); diff --git a/qemu.spec b/qemu.spec index 553ff58b..9a5b1da9 100644 --- a/qemu.spec +++ b/qemu.spec @@ -83,6 +83,7 @@ Patch0070: migration-Fix-use-after-free-during-process-exit.patch Patch0071: linux-headers-update-against-KVM-ARM-Fix-256-vcpus.patch Patch0072: intc-arm_gic-Support-IRQ-injection-for-more-than-256.patch Patch0073: ARM-KVM-Check-KVM_CAP_ARM_IRQ_LINE_LAYOUT_2-for-smp_.patch +Patch0074: 9pfs-local-Fix-possible-memory-leak-in-local_link.patch BuildRequires: flex BuildRequires: bison @@ -413,12 +414,15 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon Jan 13 2020 Huawei Technologies Co., Ltd. +- 9pfs: Fix a possible memory leak in local_link + * Mon Jan 6 2020 backport from qemu upstream - linux headers: update against "KVM/ARM: Fix >256 vcp - intc/arm_gic: Support IRQ injection for more than 256 vpus - ARM: KVM: Check KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 for smp_cpus > 256 -* Fri Nov 12 2019 backport from qemu upstream v4.0.1 release +* Thu Dec 12 2019 backport from qemu upstream v4.0.1 release - usb-tablet: fix serial compat property - blockdev-backup: don't check aio_context too early - migration/dirty-bitmaps: change bitmap enumeration method -- Gitee