xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux_gntshr_munmap: munmap takes a length, not a page count
@ 2014-09-01 12:16 David Scott
  2014-09-03  0:24 ` Stefano Stabellini
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: David Scott @ 2014-09-01 12:16 UTC (permalink / raw)
  To: xen-devel
  Cc: ian.campbell, David Scott, ian.jackson, david.vrabel,
	stefano.stabellini

This fixes a bug where if a client shares more than 1 page, the
munmap call fails to clean up everything. A process which does
a lot of sharing and unsharing can run out of resources.

Signed-off-by: David Scott <dave.scott@citrix.com>
---
 tools/libxc/xc_linux_osdep.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 86bff3e..a19e4b6 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -847,7 +847,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
 static int linux_gntshr_munmap(xc_gntshr *xcg, xc_osdep_handle h,
                                void *start_address, uint32_t count)
 {
-    return munmap(start_address, count);
+    return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
 static struct xc_osdep_ops linux_gntshr_ops = {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-09-10 14:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-01 12:16 [PATCH] linux_gntshr_munmap: munmap takes a length, not a page count David Scott
2014-09-03  0:24 ` Stefano Stabellini
2014-09-03 14:01 ` Ian Campbell
2014-09-03 14:15   ` David Vrabel
2014-09-03 14:17     ` Ian Campbell
2014-09-03 14:21       ` David Vrabel
2014-09-03 14:31         ` Ian Campbell
2014-09-03 14:38           ` Andrew Cooper
2014-09-03 15:48   ` Dave Scott
2014-09-03 16:49     ` Dave Scott
2014-09-03 17:34 ` [PATCH v2] " David Scott
2014-09-10 14:09   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).