提交 c22fe519 编写于 作者: J Julien Grall 提交者: David Vrabel

xen/xenbus: Don't leak memory when unmapping the ring on HVM backend

The commit ccc9d90a "xenbus_client:
Extend interface to support multi-page ring" removes the call to
free_xenballooned_pages() in xenbus_unmap_ring_vfree_hvm(), leaking a
page for every shared ring.

Only with backends running in HVM domains were affected.
Signed-off-by: NJulien Grall <julien.grall@citrix.com>
Cc: <stable@vger.kernel.org>
Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: NWei Liu <wei.liu2@citrix.com>
Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
上级 ad6cd7ba
...@@ -814,8 +814,10 @@ static int xenbus_unmap_ring_vfree_hvm(struct xenbus_device *dev, void *vaddr) ...@@ -814,8 +814,10 @@ static int xenbus_unmap_ring_vfree_hvm(struct xenbus_device *dev, void *vaddr)
rv = xenbus_unmap_ring(dev, node->handles, node->nr_handles, rv = xenbus_unmap_ring(dev, node->handles, node->nr_handles,
addrs); addrs);
if (!rv) if (!rv) {
vunmap(vaddr); vunmap(vaddr);
free_xenballooned_pages(node->nr_handles, node->hvm.pages);
}
else else
WARN(1, "Leaking %p, size %u page(s)\n", vaddr, WARN(1, "Leaking %p, size %u page(s)\n", vaddr,
node->nr_handles); node->nr_handles);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册