All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Marczykowski <marmarek@invisiblethingslab.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: bug in xc_gntshr_munmap?
Date: Fri, 26 Apr 2013 13:07:19 +0200	[thread overview]
Message-ID: <517A5FE7.9050904@invisiblethingslab.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 851 bytes --]

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?

-- 
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

             reply	other threads:[~2013-04-26 11:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 11:07 Marek Marczykowski [this message]
2013-04-26 13:34 ` bug in xc_gntshr_munmap? Ian Campbell
2013-04-26 13:41   ` Marek Marczykowski
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=517A5FE7.9050904@invisiblethingslab.com \
    --to=marmarek@invisiblethingslab.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.