SHA256
1
0
forked from pool/qemu
qemu/0047-pvrdma-release-device-resources-in-.patch
Bruce Rogers cfef1a70be Accepting request 666837 from home:bfrogers:branches:Virtualization
Tweak Xen interface to be compatible with upcoming v4.12 Xen. Also add CVE ref to two patches which were missing it.

OBS-URL: https://build.opensuse.org/request/show/666837
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=449
2019-01-17 22:15:55 +00:00

42 lines
1.4 KiB
Diff

From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Wed, 12 Dec 2018 23:28:17 +0530
Subject: pvrdma: release device resources in case of an error
If during pvrdma device initialisation an error occurs,
pvrdma_realize() does not release memory resources, leading
to memory leakage.
Reported-by: Li Qiang <liq3ea@163.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20181212175817.815-1-ppandit@redhat.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
(cherry picked from commit cce648613bc802be1b894227f7fd94d88476ea07)
[BR: BSC#1119437 CVE-2018-20123]
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
hw/rdma/vmw/pvrdma_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
index ca5fa8d981..34d8cc4694 100644
--- a/hw/rdma/vmw/pvrdma_main.c
+++ b/hw/rdma/vmw/pvrdma_main.c
@@ -572,7 +572,7 @@ static int pvrdma_check_ram_shared(Object *obj, void *opaque)
static void pvrdma_realize(PCIDevice *pdev, Error **errp)
{
- int rc;
+ int rc = 0;
PVRDMADev *dev = PVRDMA_DEV(pdev);
Object *memdev_root;
bool ram_shared = false;
@@ -632,6 +632,7 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp)
out:
if (rc) {
+ pvrdma_fini(pdev);
error_append_hint(errp, "Device fail to load\n");
}
}