summary refs log tree commit diff
path: root/src/linux.rs
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2018-06-05 19:52:47 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-06-07 16:52:39 -0700
commit92068bca00d7499dc789527b90efdf3daed2e927 (patch)
treea1fbdc0086e2df213eb9b7267409c2e13ce0cf71 /src/linux.rs
parent90c50419d4ed58f226a65a0751f404be26aa97c1 (diff)
downloadcrosvm-92068bca00d7499dc789527b90efdf3daed2e927.tar
crosvm-92068bca00d7499dc789527b90efdf3daed2e927.tar.gz
crosvm-92068bca00d7499dc789527b90efdf3daed2e927.tar.bz2
crosvm-92068bca00d7499dc789527b90efdf3daed2e927.tar.lz
crosvm-92068bca00d7499dc789527b90efdf3daed2e927.tar.xz
crosvm-92068bca00d7499dc789527b90efdf3daed2e927.tar.zst
crosvm-92068bca00d7499dc789527b90efdf3daed2e927.zip
wl: do not close FDs that were hungup
Before this CL, the WlState object would close VFDs that had been hungup
on the remote end as a means to removing the underlying FD from the
PollContext. However, this has some unintended side-effects. For one,
the guest would later try to delete the VFD after it was closed, which
was a double-free. Another was that every pending message that was
waiting to enter the virtio queue would get dropped if it was destined
for the closed VFD. This was especially bad if the virtio queue became
full because data would get dropped when a VFD was hungup before the
guest had any chance to read it.

This CL leaves the hungup VFDs (and therefore their pending message) as
is, but removes it from the PollContext if there is nothing left to read.
No data is removed until after the guest explicitly closes the VFD.

TEST=paste 100k characters into a guest app from Chrome
BUG=chromium:849317

Change-Id: I20e3bc7c32c3f654f88f6ef9cdfcb853f2d52f09
Reviewed-on: https://chromium-review.googlesource.com/1088308
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'src/linux.rs')
0 files changed, 0 insertions, 0 deletions