From: Peter Xu <peterx@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: pbonzini@redhat.com, mst@redhat.com, jasowang@redhat.com,
qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 3/3] memory: fix off-by-one error in memory_region_notify_one()
Date: Tue, 10 Oct 2017 18:13:54 +0800 [thread overview]
Message-ID: <20171010101354.GE20686@pxdev.xzpeter.org> (raw)
In-Reply-To: <20171010094247.10173-4-maxime.coquelin@redhat.com>
On Tue, Oct 10, 2017 at 11:42:47AM +0200, Maxime Coquelin wrote:
> This patch fixes an off-by-one error that could lead to the
> notifyee to receive notifications for ranges it is not
> registered to.
>
> The bug has been spotted by code review.
>
> Fixes: bd2bfa4c52e5 ("memory: introduce memory_region_notify_one()")
> Cc: qemu-stable@nongnu.org
> Cc: Peter Xu <peterx@redhat.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks for fixing it!
Reviewed-by: Peter Xu <peterx@redhat.com>
> ---
> memory.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/memory.c b/memory.c
> index 5e6351a6c1..b637c12bad 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1892,7 +1892,7 @@ void memory_region_notify_one(IOMMUNotifier *notifier,
> * Skip the notification if the notification does not overlap
> * with registered range.
> */
> - if (notifier->start > entry->iova + entry->addr_mask + 1 ||
> + if (notifier->start > entry->iova + entry->addr_mask ||
> notifier->end < entry->iova) {
> return;
> }
> --
> 2.13.6
>
--
Peter Xu
next prev parent reply other threads:[~2017-10-10 10:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 9:42 [Qemu-devel] [PATCH v3 0/3] exec: further refine address_space_get_iotlb_entry() Maxime Coquelin
2017-10-10 9:42 ` [Qemu-devel] [PATCH v3 1/3] exec: add page_mask for flatview_do_translate Maxime Coquelin
2017-10-10 9:42 ` [Qemu-devel] [PATCH v3 2/3] exec: simplify address_space_get_iotlb_entry Maxime Coquelin
2017-10-10 9:42 ` [Qemu-devel] [PATCH v3 3/3] memory: fix off-by-one error in memory_region_notify_one() Maxime Coquelin
2017-10-10 10:13 ` Peter Xu [this message]
2017-10-10 10:25 ` [Qemu-devel] [PATCH v3 0/3] exec: further refine address_space_get_iotlb_entry() Paolo Bonzini
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=20171010101354.GE20686@pxdev.xzpeter.org \
--to=peterx@redhat.com \
--cc=jasowang@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.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 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).