mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
devices: Deduplicate mapped file descriptors.
A bugfix to minijail made the logic more strict so deduplicate the mapping requests before giving them to libminijail. BUG=b:2591867,chromium:1198756 TEST=CQ passes Change-Id: Ide397e9aa82b493418d8ac4e51a73af649295424 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2851078 Tested-by: Allen Webb <allenwebb@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Allen Webb <allenwebb@google.com>
This commit is contained in:
parent
a88cb19890
commit
e6c584a6aa
1 changed files with 5 additions and 0 deletions
|
@ -150,6 +150,11 @@ impl ProxyDevice {
|
|||
let (child_tube, parent_tube) = Tube::pair().map_err(Error::Tube)?;
|
||||
|
||||
keep_rds.push(child_tube.as_raw_descriptor());
|
||||
|
||||
// Deduplicate the FDs since minijail expects this.
|
||||
keep_rds.sort_unstable();
|
||||
keep_rds.dedup();
|
||||
|
||||
// Forking here is safe as long as the program is still single threaded.
|
||||
let pid = unsafe {
|
||||
match jail.fork(Some(&keep_rds)).map_err(Error::ForkingJail)? {
|
||||
|
|
Loading…
Reference in a new issue