From: Marek Marczykowski <marmarek@invisiblethingslab.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: bug in xc_gntshr_munmap?
Date: Fri, 26 Apr 2013 15:41:35 +0200 [thread overview]
Message-ID: <517A840F.7060105@invisiblethingslab.com> (raw)
In-Reply-To: <1366983248.3142.100.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 1375 bytes --]
On 26.04.2013 15:34, Ian Campbell wrote:
> On Fri, 2013-04-26 at 12:07 +0100, Marek Marczykowski wrote:
>> Hi,
>>
>> Header says:
>> /*
>> * Unmaps the @count pages starting at @start_address, which were mapped by a
>> * call to xc_gntshr_share_*. Never logs.
>> */
>> int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count);
>>
>> But implementation calls:
>> static int linux_gntshr_munmap(xc_gntshr *xcg, xc_osdep_handle h,
>> void *start_address, uint32_t count)
>> {
>> return munmap(start_address, count);
>> }
>>
>> munmap(2) expect second argument to be size of mapped area (in bytes), not
>> pages count.
>>
>> Users of xc_gntshr_munmap (the only one I'm aware of is libxenvchan) already
>> uses that broken semantic.
>>
>> Is it going to be fixed (I can send trivial patch for both libxc and
>> libxenvchan), or the comment in header should be updated?
>
> I think the function should behave the same as the map side, whichever
> that is.
Map side uses pages count.
Also xc_gnttab_{grant_map,munmap} both uses pages count. So I assume it is a
bug. The question is can it be simply changed - some software can already
depend on that broken semantic...
Anyway I will send a patch in a moment.
--
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 553 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2013-04-26 13:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 11:07 bug in xc_gntshr_munmap? Marek Marczykowski
2013-04-26 13:34 ` Ian Campbell
2013-04-26 13:41 ` Marek Marczykowski [this message]
2013-04-26 12:40 ` [PATCH] libxc: fix xc_gntshr_munmap semantic Marek Marczykowski
2013-04-26 14:01 ` Marek Marczykowski
2013-04-26 14:44 ` Ian Campbell
2013-04-26 15:15 ` Daniel De Graaf
2013-04-26 15:26 ` Ian Campbell
2013-04-26 16:17 ` Daniel De Graaf
2013-04-30 10:39 ` Ian Campbell
2013-04-30 13:21 ` Daniel De Graaf
2013-04-30 14:00 ` Ian Campbell
2013-04-30 14:19 ` Daniel De Graaf
2013-04-30 14:29 ` Ian Campbell
2013-04-26 13:49 ` bug in xc_gntshr_munmap? Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=517A840F.7060105@invisiblethingslab.com \
--to=marmarek@invisiblethingslab.com \
--cc=Ian.Campbell@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.