crosvm/cros_async/Cargo.toml
Dylan Reid d086568932 cros_async: Fix reference to mem being dropped early
The Rc to BackingMemory that is passed in to memory operations was being
dropped before it is safe, The kernel can still access it until the op
is completed, so keep the reference in the pending_ops map.

Add tests so that this safety guarantees made by the executor are
exercise in unit tests.

Thanks to nkgold for finding the issue via code inspection.

BUG=none
TEST=cargo test dont_drop_backing_mem, cargo run with uring block and
run fio tests.

Change-Id: I8e4efedbbafefcbd57d7d7c340dc91a9b159b38c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2345377
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
2020-08-13 00:04:56 +00:00

23 lines
490 B
TOML

[package]
name = "cros_async"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
[dependencies]
io_uring = { path = "../io_uring" }
libc = "*"
paste = "*"
pin-utils = "0.1.0-alpha.4"
base = { path = "../base" }
syscall_defines = { path = "../syscall_defines" }
[dependencies.futures]
version = "*"
default-features = false
features = ["alloc"]
[dev-dependencies]
base = { path = "../base" }
tempfile = { path = "../tempfile" }
vm_memory = { path = "../vm_memory" }