[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen stable-4.10] memory: fix off-by-one error in memory_region_notify_one()
commit d765c5e5779fe25f8dcb7f65c9a27a7b5a77941f Author: Maxime Coquelin <maxime.coquelin@xxxxxxxxxx> AuthorDate: Tue Oct 10 11:42:47 2017 +0200 Commit: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> CommitDate: Mon Dec 4 22:42:41 2017 -0600 memory: fix off-by-one error in memory_region_notify_one() 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@xxxxxxxxxx Cc: Peter Xu <peterx@xxxxxxxxxx> Signed-off-by: Maxime Coquelin <maxime.coquelin@xxxxxxxxxx> Message-Id: <20171010094247.10173-4-maxime.coquelin@xxxxxxxxxx> Reviewed-by: Peter Xu <peterx@xxxxxxxxxx> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> (cherry picked from commit b021d1c04452276f4926eed2d104ccbd1037a6e1) Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> --- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory.c b/memory.c index d908538..d05a80a 100644 --- a/memory.c +++ b/memory.c @@ -1891,7 +1891,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; } -- generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.10 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |