[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160227104357.GA14086@mwanda>
Date:	Sat, 27 Feb 2016 13:43:57 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	"K. Y. Srinivasan" <kys@...rosoft.com>,
	Jake Oshins <jakeo@...rosoft.com>
Cc:	Haiyang Zhang <haiyangz@...rosoft.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	devel@...uxdriverproject.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] PCI: hv: potential use after free
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@...cle.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;
 		}
 	}
Powered by blists - more mailing lists
 
