[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <565EC964.3020006@citrix.com>
Date: Wed, 2 Dec 2015 10:35:16 +0000
From: David Vrabel <david.vrabel@...rix.com>
To: Doug Goldstein <cardoe@...doe.com>,
<xen-devel@...ts.xenproject.org>
CC: <linux-kernel@...r.kernel.org>, Bob Liu <bob.liu@...cle.com>,
Paul Durrant <paul.durrant@...rix.com>,
Wei Liu <wei.liu2@...rix.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Jonathan Creekmore <jonathan.creekmore@...il.com>
Subject: Re: [PATCH] xen-pciback: fix up cleanup path when alloc fails
On 26/11/15 20:32, Doug Goldstein wrote:
> When allocating a pciback device fails, avoid the possibility of a
> use after free.
We should not require clearing drvdata for correctness. We should
ensure we retain drvdata for as long as it is needed.
I note that pcistub_device_release() has:
kfree(dev_data);
pci_set_drvdata(dev, NULL);
/* Clean-up the device */
xen_pcibk_config_free_dyn_fields(dev);
xen_pcibk_config_free_dev(dev);
Which should (at a minimum) be reordered to move the kfree(dev_data) to
after the calls that require it
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists