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


Groups > linux.kernel > #1281614

Re: [PATCH] xen-pciback: fix up cleanup path when alloc fails

From David Vrabel <david.vrabel@citrix.com>
Newsgroups linux.kernel
Subject Re: [PATCH] xen-pciback: fix up cleanup path when alloc fails
Date 2015-12-02 11:40 +0100
Message-ID <qBcZl-5WX-29@gated-at.bofh.it> (permalink)
References <qzbuG-1By-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [PATCH] xen-pciback: fix up cleanup path when alloc fails David Vrabel <david.vrabel@citrix.com> - 2015-12-02 11:40 +0100
  Re: [PATCH] xen-pciback: fix up cleanup path when alloc fails Doug Goldstein <cardoe@cardoe.com> - 2015-12-02 16:00 +0100

csiph-web