crosvm/cros_async
Daniel Verkamp 9ab4f29e7a devices: vhost-user: fs: keep executor fd inside jail
A previous commit moved the creation of the executor for the vhost-user
device processes before the minijail jail_and_fork() call, and the file
descriptor of the executor was not marked for preservation when entering
the jail, so running the vhost-user-fs device would result in errors
like this:

  [WARNING:cros_async/src/sys/unix/uring_executor.rs:343] Failed to
  submit NOP for waking up executor: Failed to enter io uring: 9

This is because the io_uring context file descriptor was no longer
valid, so uring system calls would return 9 (EBADF).

Add AsRawDescriptors implementations to UringExecutor and FdExecutor so
we can preserve the fd across the minijail fork.

Other vhost-user devices were not affected because they don't enter a
jail; the fs device requires this so it can do uid/gid remapping.

BUG=b:231396155
TEST=crosvm device fs --socket /tmp/vhost.sock --tag test --shared-dir /

Fixes: d368c1520a ("devices: vhost-user: fs: remove global executor variable")
Change-Id: I38cf02034bbc28de2582e2ea92bdc13b1d6055d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3628292
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Lepton Wu <lepton@chromium.org>
2022-05-05 20:03:03 +00:00
..
src devices: vhost-user: fs: keep executor fd inside jail 2022-05-05 20:03:03 +00:00
Cargo.toml cros_async: upstream Windows support. 2022-04-19 22:19:05 +00:00