2022-09-14 05:18:14 +00:00
|
|
|
[package]
|
|
|
|
name = "swap"
|
|
|
|
version = "0.1.0"
|
2022-12-29 21:24:33 +00:00
|
|
|
authors = ["The ChromiumOS Authors"]
|
2022-09-14 05:18:14 +00:00
|
|
|
edition = "2021"
|
|
|
|
|
2023-02-28 19:01:18 +00:00
|
|
|
# The process tests will use fork, which requires a custom test harness to enforce single threaded
|
|
|
|
# execution.
|
|
|
|
[[test]]
|
|
|
|
name = "main"
|
|
|
|
path = "tests/main.rs"
|
|
|
|
harness = false
|
|
|
|
|
|
|
|
|
2022-12-05 06:27:06 +00:00
|
|
|
[features]
|
|
|
|
trace_marker = ["cros_tracing/trace_marker"]
|
2023-02-15 06:08:48 +00:00
|
|
|
log_page_fault = []
|
2022-12-05 06:27:06 +00:00
|
|
|
|
2023-01-17 20:24:29 +00:00
|
|
|
[target.'cfg(unix)'.dependencies]
|
2022-10-03 07:53:15 +00:00
|
|
|
anyhow = "*"
|
2022-09-14 05:18:14 +00:00
|
|
|
base = { path = "../base" }
|
2022-12-05 06:27:06 +00:00
|
|
|
cros_tracing = { path = "../cros_tracing" }
|
2022-12-06 20:38:11 +00:00
|
|
|
data_model = { path = "../common/data_model" }
|
swap: use create_sandbox_minijail for the monitor process
The monitor process uses the `jail` crate which devices use to create
sandbox.
The syscalls listed in the seccomp filter policy file is originally
generated from a profile by strace. Also there are additional syscalls
from common_device.policy:
* another variant of syscalls in the profile
* clone, dup, readlinkat
* the basic set which will be added by minijail compiler anyway.
* restart_syscall, exit, exit_group, rt_sigreturn
* syscalls appears only on DUT (not workstation).
* set_robust_list, sigaltstack, rseq
Used `common_device.policy` as a reference for syscalls which require
detailed conditions (e.g. clone, mmap, openat, etc).
This adds seccomp filter policy only for x86_64. The policy files for
other architectures will be added later.
BUG=b:258351526
TEST=manually tested
Change-Id: I3e584449ed9330a57ae1d2bd6c56a7554b6584ef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4253073
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-02-15 03:42:51 +00:00
|
|
|
jail = { path = "../jail"}
|
2022-09-14 05:18:14 +00:00
|
|
|
libc = "*"
|
2023-01-06 09:35:25 +00:00
|
|
|
num_cpus = "*"
|
2022-12-26 04:18:33 +00:00
|
|
|
once_cell = "*"
|
2022-09-02 15:49:50 +00:00
|
|
|
remain = "*"
|
|
|
|
serde = { version = "1", features = [ "derive" ] }
|
2022-10-14 08:06:52 +00:00
|
|
|
serde_json = "*"
|
2022-09-02 15:49:50 +00:00
|
|
|
sync = { path = "../common/sync" } # provided by ebuild
|
2022-09-30 15:36:52 +00:00
|
|
|
tempfile = "*"
|
|
|
|
thiserror = "*"
|
2023-01-30 08:33:38 +00:00
|
|
|
userfaultfd-sys = "0.4.2"
|
2022-09-14 05:18:14 +00:00
|
|
|
userfaultfd = "0.5.0"
|
2022-09-02 15:49:50 +00:00
|
|
|
vm_memory = { path = "../vm_memory"}
|
2023-02-28 19:01:18 +00:00
|
|
|
|
|
|
|
[dev_dependencies]
|
|
|
|
libtest-mimic = "0.6"
|