]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/extra/CVE-2016-10155-watchdog-6300esb-add-exit-function.patch
update upload target
[pve-qemu-kvm.git] / debian / patches / extra / CVE-2016-10155-watchdog-6300esb-add-exit-function.patch
CommitLineData
7fd7e00b
WB
1From a8341ea109259c17ad18b02597e5e03e99db60ae Mon Sep 17 00:00:00 2001
2From: Li Qiang <liqiang6-s@360.cn>
3Date: Mon, 28 Nov 2016 17:49:04 -0800
4Subject: [PATCH 1/8] watchdog: 6300esb: add exit function
5
6When the Intel 6300ESB watchdog is hot unplug. The timer allocated
7in realize isn't freed thus leaking memory leak. This patch avoid
8this through adding the exit function.
9
10Signed-off-by: Li Qiang <liqiang6-s@360.cn>
11Message-Id: <583cde9c.3223ed0a.7f0c2.886e@mx.google.com>
12Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13---
14
15Notes:
16 CVE-2016-10155
17
18 hw/watchdog/wdt_i6300esb.c | 9 +++++++++
19 1 file changed, 9 insertions(+)
20
21diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
22index a83d951..49b3cd1 100644
23--- a/hw/watchdog/wdt_i6300esb.c
24+++ b/hw/watchdog/wdt_i6300esb.c
25@@ -428,6 +428,14 @@ static void i6300esb_realize(PCIDevice *dev, Error **errp)
26 /* qemu_register_coalesced_mmio (addr, 0x10); ? */
27 }
28
29+static void i6300esb_exit(PCIDevice *dev)
30+{
31+ I6300State *d = WATCHDOG_I6300ESB_DEVICE(dev);
32+
33+ timer_del(d->timer);
34+ timer_free(d->timer);
35+}
36+
37 static WatchdogTimerModel model = {
38 .wdt_name = "i6300esb",
39 .wdt_description = "Intel 6300ESB",
40@@ -441,6 +449,7 @@ static void i6300esb_class_init(ObjectClass *klass, void *data)
41 k->config_read = i6300esb_config_read;
42 k->config_write = i6300esb_config_write;
43 k->realize = i6300esb_realize;
44+ k->exit = i6300esb_exit;
45 k->vendor_id = PCI_VENDOR_ID_INTEL;
46 k->device_id = PCI_DEVICE_ID_INTEL_ESB_9;
47 k->class_id = PCI_CLASS_SYSTEM_OTHER;
48--
492.1.4
50