All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: P J P <ppandit@redhat.com>
Cc: "Fam Zheng" <fam@euphon.net>,
	"Prasad J Pandit" <pjp@fedoraproject.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Alexander Bulekov" <alxndr@bu.edu>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Ding Ren" <rding@gatech.edu>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH v3] exec: set map length to zero when returning NULL
Date: Tue, 26 May 2020 11:19:12 +0100	[thread overview]
Message-ID: <CAFEAcA9N7n4mpznFBXgZeZnFXhCaeJwfwvJVeAc6U3W2mjQPAQ@mail.gmail.com> (raw)
In-Reply-To: <20200526075042.420162-1-ppandit@redhat.com>

On Tue, 26 May 2020 at 08:53, P J P <ppandit@redhat.com> wrote:
>
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> When mapping physical memory into host's virtual address space,
> 'address_space_map' may return NULL if BounceBuffer is in_use.
> Set and return '*plen = 0' to avoid later NULL pointer dereference.
>
> Reported-by: Alexander Bulekov <alxndr@bu.edu>
> Fixes: https://bugs.launchpad.net/qemu/+bug/1878259
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

The doc comment for this function in include/exec/memory.h
currently says
"May return %NULL if resources needed to perform the mapping
 are exhausted."

If we're tightening the API to guarantee to also set *plen to 0
in this failure case it would be good to capture that in the
documentation, eg:

"May return %NULL (and set *@plen to 0) if resources needed
 to perform the mapping are exhausted.)"

thanks
-- PMM


  parent reply	other threads:[~2020-05-26 10:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  7:50 [PATCH v3] exec: set map length to zero when returning NULL P J P
2020-05-26  8:01 ` Philippe Mathieu-Daudé
2020-05-26 10:06 ` Philippe Mathieu-Daudé
2020-05-26 10:19 ` Peter Maydell [this message]
2020-05-26 11:18   ` P J P

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=CAFEAcA9N7n4mpznFBXgZeZnFXhCaeJwfwvJVeAc6U3W2mjQPAQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alxndr@bu.edu \
    --cc=fam@euphon.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rding@gatech.edu \
    /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.