[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/29] memory: fix off-by-one error in memory_region_
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/29] memory: fix off-by-one error in memory_region_notify_one() |
Date: |
Wed, 18 Oct 2017 18:11:59 +0200 |
From: Maxime Coquelin <address@hidden>
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: address@hidden
Cc: Peter Xu <address@hidden>
Signed-off-by: Maxime Coquelin <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/memory.c b/memory.c
index 5e6351a..b637c12 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;
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/29] Misc patches for 2017-10-18, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 02/29] scsi-disk: support reporting of rotation rate, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 04/29] char: don't skip client cleanup if 'connected' flag is unset, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 01/29] checkpatch: refine mode selection, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 07/29] memory: fix off-by-one error in memory_region_notify_one(),
Paolo Bonzini <=
- [Qemu-devel] [PULL 05/29] exec: add page_mask for flatview_do_translate, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 03/29] ide: support reporting of rotation rate, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 06/29] exec: simplify address_space_get_iotlb_entry, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 08/29] pc: make sure that plugged CPUs are of the same type, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 09/29] disas: Always initialize read_memory_inner_func properly, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 10/29] build: remove CONFIG_LIBDECNUMBER, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 13/29] tco: add trace events, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 11/29] nios2: define tcg_env, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 17/29] kvm: fix alignment of ram address, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 15/29] target/i386: trap on instructions longer than >15 bytes, Paolo Bonzini, 2017/10/18