mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
cc8e94dc59
The current crosvm implementation is using `GuestMemory::checked_offset()` for the following two cases: (1) To get a valid `GuestAddress` representing `addr + offset`. (2) Guarantee that the memory range `[addr, addr+offset]` is valid. However, using `checked_offset()` for the case (2) is wrong because the method only checks if the end address `addr+offset` is valid and doesn't check if an invalid region exists between `addr` and `addr+offset`. So, this CL adds `GuestMemory::is_valid_range()` to replace the (2) cases. BUG=b:251753217 TEST=cargo test in vm_memory TEST=start a vm with virtio devices Change-Id: I21bce5d1c60acdff79284cdad963849a6e19e19c Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3945520 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: David Stevens <stevensd@chromium.org> Reviewed-by: Noah Gold <nkgold@google.com> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |