commit | f18e116c007d054f83ca5bf261c48696556f329a | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Sun Dec 18 18:27:23 2022 +0000 |
committer | David Brazdil <dbrazdil@google.com> | Sun Dec 18 23:13:44 2022 +0000 |
tree | c7df0e74582724fdac39f0b62c875f64adba9df4 | |
parent | 146bfc12f94aaf87ea8a01e00aad49404a453fbe [diff] |
virtualizationservice: Fix race in monitor_vm_exit monitor_vm_exit() runs in a detached thread, waiting for an instance of crosvm to exit. When it does, it cleans up after it and submits telemetry to statsd. However, there is currently no guarantee that the thread will get to complete its task. If exit() is called, eg. because there are no remaining clients of the service, the thread is interrupted and terminated together with the rest of the process. Whether it completes its job or not therefore can depend on the delay between the last VirtualMachine reference is dropped and LazyServiceGuard terminating the process. Fix this race by joining the monitor_vm_exit as the VirtualMachine object is dropped. This prevents the process from exiting until the thread has completed. Bug: 245727626 Test: atest -p packages/modules/Virtualization:avf-presubmit Change-Id: Iefbd4181a8ca95bbb3a4fed0f85d9929d081ff73
This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.