mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 04:07:23 +00:00
No description
A listener is responsible for managing and cleaning up its own resources, but this can cause problems when jailing device processes. Typically, the listener is created in the parent thread and then passed to the device thread so the device thread does not require the capabilities to allocate the listener's resources. However, when cleanup time comes, the listener in the child is still responsible for destroying the resources created by the parent, which may require extra capabilities. For instance, for a vhost-user socket the listener is expected to remove the socket file, but we don't necessarily want the child to be able to remove files from the filesystem... Fix this by adding a new method, take_parent_process_resources(), that can be called prior to creating the child process by the parent in order to obtain the resources that the parent needs to cleanup when the child process exits. The resources are presented in the form of an opaque box and must be kept by the parent until the child process exits. After that, dropping the box will free the resources that we don't want the child to clean up. If we are not creating a child process, then the method is simply not called and the listener will cleanup the resources itself. BUG=b:218223240 TEST=vhost-user console device gets properly cleaned up. Change-Id: I7b8c4b700a868f4fd100c45f0e577fddfe8bb216 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3762972 Reviewed-by: Morg <morg@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> |
||
---|---|---|
.cargo | ||
.devcontainer | ||
.github | ||
aarch64 | ||
acpi_tables | ||
anti_tamper | ||
arch | ||
argh_helpers | ||
base | ||
bin | ||
bit_field | ||
broker_ipc | ||
ci/kokoro | ||
common | ||
cros_async | ||
crosvm-fuzz | ||
crosvm_control | ||
crosvm_plugin | ||
devices | ||
disk | ||
docs/book | ||
fuse | ||
gpu_display | ||
hypervisor | ||
infra | ||
integration_tests | ||
io_uring | ||
kernel_cmdline | ||
kernel_loader | ||
kvm | ||
kvm_sys | ||
libcras_stub | ||
linux_input_sys | ||
logo | ||
media | ||
metrics | ||
net_sys | ||
net_util | ||
power_monitor | ||
protos | ||
qcow_utils | ||
resources | ||
rutabaga_gfx | ||
seccomp | ||
serde_keyvalue | ||
src | ||
system_api_stub | ||
tests | ||
third_party | ||
tools | ||
tpm2 | ||
tpm2-sys | ||
tracing | ||
tube_transporter | ||
usb_sys | ||
usb_util | ||
vfio_sys | ||
vhost | ||
virtio_sys | ||
vm_control | ||
vm_memory | ||
win_audio | ||
win_util | ||
x86_64 | ||
.dockerignore | ||
.gitignore | ||
.gitmodules | ||
.rustfmt.toml | ||
ARCHITECTURE.md | ||
Cargo.toml | ||
CONTRIBUTING.md | ||
LICENSE | ||
navbar.md | ||
OWNERS | ||
PRESUBMIT.cfg | ||
README.chromeos.md | ||
README.md | ||
run_tests | ||
rust-toolchain | ||
setup_cros_cargo.sh | ||
test_all | ||
unblocked_terms.txt |
crosvm - The Chrome OS Virtual Machine Monitor
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.
- Documentation
- Announcements
- Developer Mailing List
- #crosvm on matrix.org
- Source code
- API doc, useful for searching API.
- For contribution, see the contributor guide. Mirror repository is available at GitHub for your convenience, but we don't accept bug reports or pull requests there.
- Issue tracker