All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Riku Voipio" <riku.voipio@iki.fi>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user: fix host_to_target_cmsg in case of multiple headers
Date: Sat, 29 Aug 2015 18:04:49 +0200	[thread overview]
Message-ID: <20150829160449.GB8212@latitude> (raw)
In-Reply-To: <CAFEAcA8cDsVfN-Pu8WgTvKR9SaDysWqsL8RAiDW=epD-Z+Ex7A@mail.gmail.com>

On Thu, Aug 27, 2015 at 07:06:24PM +0100, Peter Maydell wrote:
> This definitely looks like a bug, but I don't think this is
> a sufficient fix, because if DEBUG_REMAP is defined then the
> locked-memory which the target_cmsghdr* is in is not a
> simple g2h() away from the host pointer.
> 
> What you need to do is change target_to_host_cmsg and
> host_to_target_cmsg so that when at the top of the function
> we do:
>     target_cmsg_addr = tswapal(target_msgh->msg_control);
>     target_cmsg = lock_user(VERIFY_READ, target_cmsg_addr, msg_controllen, 1);

After following your advice, I found two more bugs in related code,
which I had to fix. I probably missed something, but my test case
(wine), which receives two headers via a single recvmsg call, is now
working properly. Perhaps an isolated test case would be nice.

I'll send my new patch soon.


Regards,
Jonathan Neuschäfer

  reply	other threads:[~2015-08-29 16:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 14:50 [Qemu-devel] [PATCH] linux-user: fix host_to_target_cmsg in case of multiple headers Jonathan Neuschäfer
2015-08-27 18:06 ` Peter Maydell
2015-08-29 16:04   ` Jonathan Neuschäfer [this message]
2015-08-29 16:35     ` Peter Maydell
2015-08-31 19:27     ` [Qemu-devel] [PATCH] linux-user: fix cmsg conversion " Jonathan Neuschäfer
2015-09-01 15:45       ` Peter Maydell
2015-09-02  3:12         ` Jonathan Neuschäfer
2015-09-03  5:27         ` Jonathan Neuschäfer
2015-09-04 12:48           ` Peter Maydell
2015-09-21  5:34             ` Jonathan Neuschäfer
2015-09-21 13:13               ` Peter Maydell
2015-09-21 19:45                 ` Riku Voipio
2015-09-21 19:50                   ` Jonathan Neuschäfer
2015-09-28 13:38           ` Riku Voipio
2015-09-28 22:07             ` Jonathan Neuschäfer

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=20150829160449.GB8212@latitude \
    --to=j.neuschaefer@gmx.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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.