New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 835916 link

Starred by 6 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

crosvm: plugin process per vcpu state is actually shared between vcpus

Project Member Reported by za...@chromium.org, Apr 23 2018

Issue description

Because Vec::resize uses a default clone-able prototype when growing the size of a Vec, and Arc::clone merely increases the reference count on the underlying data, there is only one PerVcpuState data structure used by all VCPUs. The correct behavior is that there is a unique PerVcpuState for each VCPU. 
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/da3f64c8fe01dae1eaf1e1fc192dfcd711dc1dbe

commit da3f64c8fe01dae1eaf1e1fc192dfcd711dc1dbe
Author: Zach Reizner <zachr@google.com>
Date: Fri Apr 27 00:00:36 2018

crovm/plugin: fix PerVcpuState to be per vcpu

Because resize was used to grow a vec, each Arc<Mutex<PerVcpuState>> was
cloned from the original Default, merely increasing the ref count on the
same default data.

This change manually pushes a unique set of data per vcpu.

BUG= chromium:835916 
TEST=None

Change-Id: I7116c764effd0f33f706f912bcf4d5d28ba1e08e
Reviewed-on: https://chromium-review.googlesource.com/1024504
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Aleksandr Kartashov <regmka@gmail.com>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/da3f64c8fe01dae1eaf1e1fc192dfcd711dc1dbe/src/plugin/process.rs

Comment 2 by za...@chromium.org, Apr 27 2018

Status: Verified (was: Started)

Sign in to add a comment