Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1344981

[patch] PCI: hv: potential use after free

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [patch] PCI: hv: potential use after free
Date 2016-02-27 11:50 +0100
Message-ID <r6KBI-1Bx-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


If we throw away the very last item on the list, then we could end up
with a use after free of "dr".

Fixes: 15ca17645f19 ('PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 9391dee..9b66ffe 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1397,6 +1397,7 @@ static void pci_devices_present_work(struct work_struct *work)
 		/* Throw this away if the list still has stuff in it. */
 		if (!list_empty(&hbus->dr_list)) {
 			kfree(dr);
+			dr = NULL;
 			continue;
 		}
 	}

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[patch] PCI: hv: potential use after free Dan Carpenter <dan.carpenter@oracle.com> - 2016-02-27 11:50 +0100
  RE: [patch] PCI: hv: potential use after free Jake Oshins <jakeo@microsoft.com> - 2016-02-29 18:30 +0100
    Re: [patch] PCI: hv: potential use after free Dan Carpenter <dan.carpenter@oracle.com> - 2016-02-29 20:40 +0100

csiph-web